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

If an error occurs in main.js, atom-shell does not output that error but instead reports that the app is invalid. #294

Closed
Twipped opened this issue May 12, 2014 · 7 comments

Comments

@Twipped
Copy link

Twipped commented May 12, 2014

Even when launching from the command line, any JS error occuring in main.js is internally trapped, preventing debugging. Instead, you get the following:

screenshot 2014-05-12 09 38 03

The error is not reported in the console.

@Nicolab
Copy link

Nicolab commented May 13, 2014

Checks the path of the main.js in package.json, if the path is ok, tries adding in the main.js:

process.on('error', function(err) {
  console.log(err);
});

@Twipped
Copy link
Author

Twipped commented May 13, 2014

There is nothing wrong with the structure of the app, that's why I'm reporting the dialog. In this specific case I had a typo in one of my require statements in main.js, but I've also been able to reproduce it by syntax errors in modules required within main.js. I found the problems by running the modules outside of atom-shell. Once I fixed the mistakes, the program launched fine.

I've tried detecting it with process.on('error', ..., 'process.on('uncaughtException', ... and using the included crash-reporter. None of them were able to report what was causing the crash.

@Nicolab
Copy link

Nicolab commented May 15, 2014

@ChiperSoft indeed :)

@huvber
Copy link

huvber commented Mar 30, 2015

I still have this problem so I think isn't close. There are someway to let atom-shell show wich is the error?

@chemdemo
Copy link

Just delete this line:

require('crash-reportor').start();

@sher
Copy link

sher commented May 18, 2015

I get the same error often on startup. The reason, for me usually, is requiring non-existent file or module name typo in require method:

var a = require('./wrong-path');

@danShumway
Copy link

+1 This is a bug - an incorrect require statement isn't really the same as an invalid app, which makes this error deceptive at best.

The attached commit seems to just manually detect when a module isn't found and then still throw the same error, regardless. Is there something I'm missing? It seems like what you want to detect is if one of the key modules is missing (ie main.js), but this looks to report the same error regardless of which require statement goes wrong.

Absent of a more in-depth solution, could the error message be modified to mention require statements in some way? This can be a pain in the neck to debug if you don't already know that a script error can trigger this.

kevinsawicki added a commit that referenced this issue May 9, 2017
kevinsawicki added a commit that referenced this issue May 9, 2017
kevinsawicki added a commit that referenced this issue May 10, 2017
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

7 participants