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

Error when adding a module dependency #2

Open
tom-thorne opened this issue May 25, 2018 · 0 comments
Open

Error when adding a module dependency #2

tom-thorne opened this issue May 25, 2018 · 0 comments

Comments

@tom-thorne
Copy link

The template works out of the box. However, as soon as you yarn add any dependency and use it in your code, you get a runtime error (se below).

This is solved by removing the package block in the serverless.yml file, which was excluding node_modules from the package.

I am not clear what the intention is here - should node_modules be excluded and some other setting or plugin is missing?

Unable to import module ‘handler’: Error
   at Function.Module._resolveFilename (module.js:547:15)
   at Function.Module._load (module.js:474:25)
   at Module.require (module.js:596:17)
   at require (internal/module.js:11:18)
   at Object.<anonymous> (/var/task/handler.js:3:16)
   at Module._compile (module.js:652:30)
   at Object.Module._extensions..js (module.js:663:10)
   at Module.load (module.js:565:32)
   at tryModuleLoad (module.js:505:12)
   at Function.Module._load (module.js:497:3)
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

1 participant