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

Expose serverless-webpack build errors #191

Closed
adambiggs opened this issue Jan 27, 2017 · 4 comments · May be fixed by Itchibon777/serverless-offline#57 or Itchibon777/serverless-offline#58
Closed

Comments

@adambiggs
Copy link

When serverless-offline is running and I make code changes, the console output always displays Webpack rebuilt, even if the code contains errors and the rebuild failed.

Then, instead of a sensible error about my badly formed code, I get a "Cannot find module" error when invoking the function.

I just wasted close to an hour thinking something was wrong with my Webpack module resolution config... I didn't realize what the real problem was until I ran $ sls webpack which gave me a nicely formatted error about my badly formed code.

Is there a way to expose these error messages when serverless-offline triggers a Webpack rebuild?

@adambiggs adambiggs changed the title Expose Webpack build errors Expose serverless-webpack build errors Jan 27, 2017
@dherault
Copy link
Owner

Hi @adambiggs, thanks for raising this issue.

I don't know much about sls webpack, I think I know were the error is swallowed.
I might take a look. Anyone with intel on the matter please share :)

@mikestaub
Copy link
Contributor

A quick solution would be to include bail: true in your webpack.config.js file. This will cause serverless-offline to crash with the error. Not sure if there is a more graceful solution.

@adambiggs
Copy link
Author

Thanks @mikestaub that's definitely an improvement.

@stefan-contiero
Copy link

Incurred in the same problem, if it can helps anyone, installing the friendly-errors-webpack-plugin resolve the issue!

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