outmoded / discuss

The "mailing list"
99 stars 9 forks source link

Hapi eats all javascript syntax error? #221

Closed framerate closed 8 years ago

framerate commented 8 years ago

I cut/paste a large chunk of code from another project into a brand new route. It passes my ESLint and seems ok at first glance.

When I view my index (not the new route) I get:

screen shot 2016-02-03 at 4 15 42 pm

The error turns out to be the code contained ES6 destructuring which node didn't support.

There are no errors in my console from node nor hapi.

I'm new to Hapi but I feel like anything like this in Express or other frameworks they crash out and tell me "Unexpected Syntax: Line 102".

Any help would be appreciated.

Icehunter commented 8 years ago

Further to this if you require 'babel-polyfill" the routes do actually function correctly. Is it intended to eat code?

framerate commented 8 years ago

Yeah I wouldn't expect it to work without the polyfill, but I would expect to be notified of my error...

Although I recognize this could be so many other things... use of promises perhaps... But overall this is a dead simple hapi boilerplate with 2 routes.

framerate commented 8 years ago

This is looking to not be a hapi error but an ES6 Promises error.

More info here:

http://jamesknelson.com/are-es6-promises-swallowing-your-errors/