wallabyjs / atom-wallaby

Wallaby.js atom package starter
Other
57 stars 6 forks source link

Parse error #13

Closed aaronjensen closed 8 years ago

aaronjensen commented 8 years ago

So I got this error and spent the next 20 minutes or so trying to figure out what the heck it was.

developer tools 2015-09-22 09-20-08

Turns out I had added a webpack alias to one of my own files (that needed to go through babel) but hard coded the absolute path. The "Parse error" was because there was a let in that file.

It'd be really nice if it somehow told me what file it was and/or showed the entire parse error, (the log wasn't even helpful, because it wasn't the previously served module).

ArtemGovorov commented 8 years ago

Unfortunately, it's PhantomJs 1.x error reporting issue. SyntaxError: Parse error message is everything it gives back for errors like this one. Wallaby displays the message, Karma just silently stops working when it hits it as far as I know.

I understand your pain, sometimes it gets really weird and hard to track, like in this case https://github.com/wallabyjs/public/issues/33, but unfortunately there's just no additional information from PhantomJs.

Thankfully, it's a pretty rare case. If anything is caught during processing phase (like babel errors), it gets reported. Later, if the page is loaded then wallaby is able to report any uncaught errors as well. But this specific type of error happens before we can do anything - when PhantomJs javascript engine (JavaScriptCore) for whatever reason can't parse the code (and fails to provide a better error message). From what I have heard, the issue may be gone in PhantomJs 2, so one of the options may be to consider migrating to it, wallaby.js does support it.

aaronjensen commented 8 years ago

Unfortunately, we use karma and the phantomjs npm package, which is still on 1.9 https://github.com/Medium/phantomjs/issues/288 so moving to 2.0 won't fly just yet. I suppose I could use it conditionally if it is installed to a known path, but I'd worry about test differences between the two.

ArtemGovorov commented 8 years ago

Got it. You could try using the https://www.npmjs.com/package/karma-phantomjs2-launcher package for karma (and use the same package relative path for wallaby). If all of your tests are passing in both, the migration seems pretty easy.

ArtemGovorov commented 8 years ago

Though there're no 'official' binary packages of PhantomJs2 for Linux and I have heard from JetBrains front-enders that they were having issues with several unofficial ones when trying to set Linux box CI build with karma.

aaronjensen commented 8 years ago

Yeah, that's kind of why I'm avoiding it for now, it doesn't quite seem to be ready. I DM'd you a log on twitter btw.

ArtemGovorov commented 8 years ago

Ok, so I can't fix the issue itself, but I have improved the error message in this case and it's now also displayed on the Panel (core v1.0.117):

screen shot 2015-09-24 at 5 35 07 pm

Hope it's more helpful now.

DM'd you a log on twitter btw.

Yep, so please let me know if I can get access the source once you find it out.

aaronjensen commented 8 years ago

Thanks!