question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'babel-polyfill'

See original GitHub issue

Hello,

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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ChuanfengZhangcommented, Dec 8, 2017

@vladtamas What do you forgot to set?

3reactions
vladtamascommented, Jul 23, 2017

@HyperBrain Yes. I forgot to set something in the configuration

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I install the babel-polyfill library? - Stack Overflow
And you get the Cannot find module 'babel/polyfill' error message, then you probably just need to change your import statement FROM:
Read more >
Cannot find module 'babel/polyfill' · Issue #6 · IanVS/eslint-nibble
Hello, Babel is actually required to run eslint-nibble, so it fails if Babel is not installed with this error : module.js:338 throw err; ......
Read more >
@babel/polyfill - npm
Provides polyfills necessary for a full ES2015+ environment. Latest version: 7.12.1, last published: 2 years ago.
Read more >
How do I install the babel-polyfill library | Edureka Community
I just started to use Babel to compile my ES6 javascript code into ES5. When I start to use Promises it looks like...
Read more >
babel/polyfill
The polyfill is provided as a convenience but you should use it with @babel/preset-env and the useBuiltIns option so that it doesn't include...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found