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.

Error: Cannot find module '../constants'

See original GitHub issue

Bug Report

  • I would like to work on a fix!

Current Behavior When running webpack I’m getting the following error on roughly half of the entry points that get picked up by babel-loader:

overlapping.get is not a function (While processing: “/Users/me/Documents/GitHub/my-project/node_modules/@babel/preset-env/lib/index.js”

  • REPL, Codesandbox, or GitHub Repo link if applicable: n/a Input Code
{
        test: /\.js$/,
        exclude: /node_modules\/(?![url-regex|normalize-url])|vendor/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
            cacheDirectory: true
          }
        }
      }

Expected behavior/code Expecting webpack to bundle my files.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

  • Filename: babel.config.js
{
  "presets": [
    ["@babel/preset-env", {
      "targets": {
        "browsers": [ ">0.5%", "last 2 versions", "not ie <= 11"]
      }
    }]
  ],
  "plugins": [
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-object-rest-spread",
    "@babel/plugin-transform-for-of"
  ]
}

Environment

  System:
    OS: macOS 10.15.4
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v10.15.3/bin/npm
  npmPackages:
    @babel/core: ^7.9.6 => 7.9.6 
    @babel/plugin-proposal-class-properties: ^7.8.3 => 7.8.3 
    @babel/plugin-proposal-object-rest-spread: ^7.9.6 => 7.9.6 
    @babel/plugin-syntax-dynamic-import: ^7.8.3 => 7.8.3 
    @babel/plugin-transform-for-of: ^7.9.0 => 7.9.0 
    @babel/plugin-transform-spread: ^7.8.3 => 7.8.3 
    @babel/polyfill: ^7.8.7 => 7.8.7 
    @babel/preset-env: ^7.9.6 => 7.9.6 
    babel-cli: ^6.26.0 => 6.26.0 
    babel-eslint: ^10.1.0 => 10.1.0 
    babel-loader: ^8.1.0 => 8.1.0 
    babel-plugin-add-module-exports: ^0.2.1 => 0.2.1 
    babel-plugin-syntax-async-functions: ^6.13.0 => 6.13.0 
    babel-polyfill: ^6.26.0 => 6.26.0 
    babel-preset-env: ^1.7.0 => 1.7.0 
    babel-preset-stage-3: ^6.24.1 => 6.24.1 
    eslint: ^5.16.0 => 5.16.0 
    eslint-plugin-babel: ^5.3.0 => 5.3.0 
    webpack: ^4.43.0 => 4.43.0 
  • How you are using Babel: loader

Possible Solution Unknown

Additional context/Screenshots n/a

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
existentialismcommented, May 14, 2020

@phil-warner sidenote, you have both v6 and v7 babel deps in your package.json, might want to switch to v7 completely (babel-* -> @babel/*)

0reactions
phil-warnercommented, May 20, 2020

This problem was fixed by adding “@babel/plugin-transform-for-of” to by Babel plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
This happens when a first npm install has crashed for some reason (SIGINT of npm), or that the delay was too long, or...
Read more >
Error: cannot find module [Node npm Error Solved]
When you get the “cannot find module” error, or “module not found”, it means you've not installed the package you're trying to use....
Read more >
Cannot find module 'X' error in Node.js
To solve the "Cannot find module" error in Node.js, make sure to install the package from the error message if it's a third-party...
Read more >
How to resolve can't find module error in Node.js
To fix Cannot find module errors, install the modules properly by running a npm install command in the appropriate directory as your project's ......
Read more >
How to resolve "Cannot find module" error in Node
The Cannot find module error is a common error that usually happens when dependencies are not installed. Once you install your dependencies and ......
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