Closed artcommacode closed 6 years ago
If you can figure out what file it was trying to parse when it blew up that would be helpful.
One idea would be to put breakpoints in some places mentioned in that stack trace.
@ef4 I'm running into this issue as well and in my case it seems to be a weird transformation issue in combination with ember-electron. The parser borks on the following line, which is, as far as I can see, not valid JS:
const { app, BrowserWindow, protocol };
The original file, which is "tests/ember-electron/main.js" looks like this:
const { app, BrowserWindow, protocol } = require('electron');
So something in the build process is mangling the file. I'm not familiar enough with the build process to quickly figure out what's going on there, but I'll take a look at other updates I made together with the ember update to see if I can find something.
One thing that probably needs fixing is the way the error message is constructed as the humongous stack trace of the error completely swallows the important bit that is supposed to be in there, which is the full path to the file in question, see stubs.js.
@artcommacode The easiest way of figuring out the real culprit seems to be to patch the stubs.js file of ember-browserify locally (namely the importsFor function) to just console.log out the fullPath and the actual source of the file (as it operates on processed files) so that you can see where exactly the parser borks.
Finally got the time to look into this properly and turns out it's failing for me at exactly the same place is for @halfbyte. (/tests/ember-electron/main.js
)
For now I've simply hacked up ember-browserify
to stop Throw
ing errors when it encounters them but I'm also wondering if it needs to be doing this in the first place? Or maybe there's a different way of handling this?
I went looking for where that file is coming from and it doesn't exist in current versions of ember-electron. I think they deliberately moved it because it was being transpiled incorrectly:
Thanks @ef4, that makes things even easier! I'm happy with this solution
Error parsing code while looking for "npm:" imports: SyntaxError: Unexpected token (5:40)
Error log:
Let me know if there's anything else I can provide for you.