Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Unable to package a project which includes blessed #530

Closed
Losses opened this issue Sep 17, 2018 · 6 comments
Closed

Unable to package a project which includes blessed #530

Losses opened this issue Sep 17, 2018 · 6 comments

Comments

@Losses
Copy link

Losses commented Sep 17, 2018

While packaging a project with blessed, it wont run properly(but runs well without pkg).

The process of reproducing this problem:

Error information:

TypeError: Cannot read property 'isAlt' of undefined
    at Screen.leave (C:\snapshot\blessed-master\node_modules\blessed\lib\widgets\screen.js:309:21)
    at Screen.destroy (C:\snapshot\blessed-master\node_modules\blessed\lib\widgets\screen.js:411:8)
    at C:\snapshot\blessed-master\node_modules\blessed\lib\widgets\screen.js:216:14
    at Array.forEach (<anonymous>)
    at process.Screen.bind.process.on.Screen._exceptionHandler (C:\snapshot\blessed-master\node_modules\blessed\lib\widgets\screen.js:215:30)
    at process.emit (events.js:182:13)
    at process._fatalException (internal/bootstrap/node.js:484:27)

Platform:
Windows 10, Yarn 1.9.2, node 10.1.10

I'm not sure the problem is caused by blessed or pkg, maybe someone can kindly figure it out?

@JoshMcCullough
Copy link

I'm having this issue as well.

@tongwing
Copy link

The reason is 'cos some files in the blessed module are not included by pkg. Try adding the following in your package.json:

"pkg": { "assets": "node_modules/blessed/**/*" }

@Losses
Copy link
Author

Losses commented Jun 27, 2019

@tongwing Wow, thanks, i'll have a try

Thann added a commit to Thann/pingg that referenced this issue Aug 22, 2019
@ChrisPei
Copy link

ChrisPei commented Jan 5, 2020

Same issues.

add pkg in my package.json
"pkg": { "assets": "node_modules/blessed/**/*" }

still throw error:
TypeError: Cannot read property 'isAlt' of undefined

@igorklopov
Copy link
Contributor

Please try with [email protected]

@JoshMcCullough
Copy link

JoshMcCullough commented Feb 11, 2020

Note that there is a "bug" in screen.js, fixed by this PR, which prevents the actual error from showing in cases where the app / screen didn't even get to initialize properly (I assume). This is the case indicated by @ChrisPei, above. I had the same issue but fixed it by doing what is shown in the PR. Now I get this error when running the packaged binary:

Error: File '/**/multi-git/node_modules/blessed/usr/xterm' was not included into executable at compilation stage. Please recompile adding it as asset or script.
at error_ENOENT (pkg/prelude/bootstrap.js:429:17)
at readFileFromSnapshot (pkg/prelude/bootstrap.js:657:29)
at Object.fs.readFileSync (pkg/prelude/bootstrap.js:700:18)
at Tput.readTerminfo (/snapshot/multi-git/node_modules/blessed/lib/tput.js:157:13)
at Tput.compileTerminfo (/snapshot/multi-git/node_modules/blessed/lib/tput.js:623:28)
at Tput.injectTerminfo (/snapshot/multi-git/node_modules/blessed/lib/tput.js:627:27)
at Tput._useXtermInfo (/snapshot/multi-git/node_modules/blessed/lib/tput.js:118:15)
at Tput.setup (/snapshot/multi-git/node_modules/blessed/lib/tput.js:92:10)
at new Tput (/snapshot/multi-git/node_modules/blessed/lib/tput.js:63:10)
at Program.setupTput (/snapshot/multi-git/node_modules/blessed/lib/program.js:251:26)

I took the advise of the error message and @Losses and now my app runs okay at first glance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants