serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix/discourage use of Yarn with serverless-webpack

dpiatek opened this issue · comments

commented

This is a Bug Report

Description

We have a fairly straightforward serverless app that uses this package, yarn for module installation and the externals auto-packing config as described here https://github.com/serverless-heaven/serverless-webpack#node-modules--externals .

We deploy our app from CircleCi which uses node 6.10.3/npm 3.x. We have a lambda that has npm dependencies, and within node_modules they are being hoisted as they are shared. When serverless-webpack does auto-packing it runs an npm install which results in an incomplete package - the lambda fails because the hoisted dependencies are not there.

Our fix was to upgrade to npm 5.x on CircleCI, which creates the package-lock.json, but really it would be great if the docs were explicit that this is going on behind the scenes - or ideally, support yarn.

Happy to help with this and many thanks for your hard work.

Additional Data

  • Serverless-Webpack Version you're using: 4.0.0
  • Webpack version you're using: 3.8.1
  • Serverless Framework Version you're using: 1.24.0
  • Operating System: Ubuntu 14.04

@dpiatek Thanks for the suggestion, fully agree with that 👍

There is already a feature task #286 that targets exactly the solution for the problem.

Maybe for now, until the feature is there, it would help to explicitly state possible problems and safe solutions in the README. This issue could be used for a README improvement though.

As you are deeply involved with the yarn issue, could you add a PR for a proper README extension, that will help users to workaround the problem for now? 😄

commented

Yes, saw that @HyperBrain ! Thought I'll add a separate issue for people who might encounter it.

Happy to do the README PR :)