serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throw error when webpack entry is configured and package individually is true

ceilfors opened this issue · comments

This is a Feature Proposal

Description

Context: When package individually is set to true, webpack entry should not be configured at all. This is currently the expected behaviour. It is however not explicit enough to the plugin user and it will fail with some other error.

Proposal: Throw an error when webpack entry is configured and package individually is set to true.

Related to:

Additional Data

  • Serverless-Webpack Version you're using:
    3.1.2

  • Webpack version you're using:
    3.5.5

  • Serverless Framework Version you're using:
    1.23.0

  • Operating System:
    OS X 10.10.5

  • Stack Trace (if available):

Type error:

  Type Error ---------------------------------------------

  Path must be a string. Received [ 'babel-polyfill',
  'source-map-support/register',
  './packages/core/src/alexa-skill.js' ]

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.


Stack trace:
  Stack Trace --------------------------------------------

TypeError: Path must be a string. Received [ 'babel-polyfill',
  'source-map-support/register',
  './packages/core/src/alexa-skill.js' ]
    at assertPath (path.js:28:11)
    at Object.relative (path.js:1248:5)
    at entryFunctions._.flatMap (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/serverless-webpack/lib/validate.js:154:28)
    at /Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:3554:27
    at /Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:4944:15
    at baseForOwn (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:3001:24)
    at /Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:4913:18
    at baseMap (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:3553:7)
    at map (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:9571:14)
    at Function.flatMap (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/lodash/lodash.js:9274:26)
    at ServerlessWebpack.validate (/Users/ceilfors/github/realtime-ww2-alexa/node_modules/serverless-webpack/lib/validate.js:153:31)
From previous event:
    at PluginManager.invoke (/Users/ceilfors/.nvm/versions/node/v8.1.2/lib/node_modules/serverless/lib/classes/PluginManager.js:360:22)
    at PluginManager.run (/Users/ceilfors/.nvm/versions/node/v8.1.2/lib/node_modules/serverless/lib/classes/PluginManager.js:391:17)
    at variables.populateService.then (/Users/ceilfors/.nvm/versions/node/v8.1.2/lib/node_modules/serverless/lib/Serverless.js:99:33)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
    at Serverless.run (/Users/ceilfors/.nvm/versions/node/v8.1.2/lib/node_modules/serverless/lib/Serverless.js:86:74)
    at serverless.init.then (/Users/ceilfors/.nvm/versions/node/v8.1.2/lib/node_modules/serverless/bin/serverless:39:50)
    at <anonymous>

Released with 4.1.0