Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window disappears when requiring a lib with a large dependency #17

Open
kuba-orlik opened this issue Jul 18, 2018 · 0 comments
Open

Window disappears when requiring a lib with a large dependency #17

kuba-orlik opened this issue Jul 18, 2018 · 0 comments

Comments

@kuba-orlik
Copy link

kuba-orlik commented Jul 18, 2018

I've been encountering random "soft crashes" of my simple react-yue app. The app started to crash once I added require("jsdom") to it. I assumed that something in jsdom interferes with node-gui and spent more than 3 days looking for a cause. Eventually I realized it's not the content of the required dependency, but its size.

How to reproduce

I'll use react-yue-app as the simplest example.

After cloning the repo, running the app as it is works just fine.

Then let's generate a large JSON file:

seq 20000000 | awk 'BEGIN {print "["} {print $0 ","} END {print "\"end\"]"}' > numbers-large.json

and then add

require("./numbers-large.js");

to the app code.

Now the app runs, but no window appears. Putting require("./numbers-large.js"); in a setTimeout causes the window to appear, and then disappear after a short amount of time.

The app doesn't crash. The window just disappears.

EDIT: on some occasions the window doesn't disappear immediately, but after around 8 seconds.

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

No branches or pull requests

1 participant