Cannot find module 'babel-polyfill'
See original GitHub issueHello,
I have an issue with my lambda function when I try to execute it.
{ “errorMessage”: “Cannot find module ‘babel-polyfill’”, “errorType”: “Error”, “stackTrace”: [ “Function.Module._load (module.js:417:25)”, “Module.require (module.js:497:17)”, “require (internal/module.js:20:19)”, “Object.<anonymous> (/var/task/auth.js:55:19)”, “webpack_require (/var/task/auth.js:20:30)”, “Object.<anonymous> (/var/task/auth.js:47:2)”, “webpack_require (/var/task/auth.js:20:30)”, “/var/task/auth.js:40:18”, “Object.<anonymous> (/var/task/auth.js:43:10)” ] }
Webpack.config.js: `const nodeExternals = require(‘webpack-node-externals’); const path = require(‘path’); const CopyWebpackPlugin = require(‘copy-webpack-plugin’);
module.exports = { entry: { auth: [‘babel-polyfill’, ‘./api/auth.js’], handler: [‘babel-polyfill’, ‘./api/handler.js’], }, output: { path: path.join(__dirname, ‘./.webpack’), filename: ‘[name].js’, libraryTarget: ‘commonjs’, }, target: ‘node’, devtool: ‘source-map’, externals: [nodeExternals({ modulesFromFile: true, })], module: { loaders: [ { test: /.js$/, loaders: [‘babel’], include: __dirname, exclude: /node_modules/, }, { test: /.html$/, loader: ‘mustache’, }, ], }, };`
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
@vladtamas What do you forgot to set?
@HyperBrain Yes. I forgot to set something in the configuration