Skip to content

Build fails: Could not find plugin "proposal-numeric-separator" #8680

Closed

Description

@muehlbaueralex

Describe the bug

Running npm run build will fail on any project, even on a vanilla app created with create-react-app will fail with the following error:

Error: [BABEL] /Users/<username>/Projects/my-app/src/index.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/Users/<username>/Projects/my-app/node_modules/babel-preset-react-app/index.js$0")
    at Array.map (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

From our build pipelines I can tell it started roughly around Mar 20, 2020 4:48pm GMT+0100

Did you try recovering your dependencies?

I tried recovering the module tree and even verified with a vanilla app. It happens on my local machine and on our build machines with no changes involved there.

$ npm --version
6.13.1

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

$ npx create-react-app --info

Environment Info:

  System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  Binaries:
    Node: 13.2.0 - /usr/local/bin/node
    Yarn: 1.19.2 - /usr/local/bin/yarn
    npm: 6.13.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: 68.0.2
    Safari: 13.0.5
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.0 => 3.4.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app my-app
  2. cd my-app
  3. npm run build

Expected behavior

The build is successful with no error.

Reproducible demo

As mentioned in the above sections a vanilla app is enough to reproduce.

  1. npx create-react-app my-app
  2. cd my-app
  3. npm run build

Activity

  1. rosbel commented on Mar 20, 2020

    @rosbel
  2. Volosh1n commented on Mar 20, 2020

    @Volosh1n
  3. adascal commented on Mar 20, 2020

    @adascal

    Possible related to new babel-loader release (about 2 hours ago)
    ref: https://github.com/babel/babel-loader/releases

  4. floofydoug commented on Mar 20, 2020

    @floofydoug
  5. PFadel commented on Mar 20, 2020

    @PFadel
  6. Binbiubiubiu commented on Mar 20, 2020

    @Binbiubiubiu

    me too

  7. gonzofish commented on Mar 20, 2020

    @gonzofish

    Hey everyone, thumbs up the original post. Adding "me too" just becomes noise to the maintainers

  8. existentialism commented on Mar 20, 2020

    @existentialism
    Contributor

    This bug was fixed in Babel by babel/babel#11201, and here once #8620 gets released.

  9. gonzofish commented on Mar 20, 2020

    @gonzofish

    Thanks @existentialism! Is there any solution/workaround in the meantime?

  10. marvelousdev0 commented on Mar 20, 2020

    @marvelousdev0

    I’m using babel-loader@8.0.6, but still have the issue

  11. MKrupauskas commented on Mar 20, 2020

    @MKrupauskas

    Ejecting and updating the babel dependency would be a way of fixing this in the meantime.

  12. MMachado-uy commented on Mar 20, 2020

    @MMachado-uy

    +1

  13. apipemc commented on Mar 20, 2020

    @apipemc
  14. 62 remaining items

  15. carlos-soto commented on Mar 20, 2020

    @carlos-soto

    @stenwie0591 our team is also experiencing error on Heroku deploy for a node react app using yarn. Workaround is not doing anything for us either.
    We are seeing the following error:

    [!] (plugin babel) ReferenceError: /tmp/build_4c6997ef6fd5b4162d9721111196c3c8/packages/core-ui/src/index.js: Unknown helper createSuper
    

    Not seeing the issue happen when building locally, however specified "@babel/preset-env": "^7.8.0", and ran yarn install and then it reproduced locally. It seems like heroku is bumping or not respecting lock file?

    if it is bumping or not respecting then remove the caret likes this: "@babel/preset-env": "7.8.0",

    Heroku updates the dependencies - hence the error.
    We got this locally itself. npm update was good but the error appeared in npm start.

    Starting the development server...
    Failed to compile.
    ./node_modules/react-dev-utils/webpackHotDevClient.js
    Error: [BABEL] C:\projects\react\node_modules\react-dev-utils\webpackHotDevClient.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\projects\react\node_modules\babel-preset-react-app\dependencies.js$0")
    at Array.map ()
    at Generator.next ()

    Tried with "react-scripts": "3.4.0", and "react-scripts": "3.4.0" - no success.
    Changed @babel/preset-env": "^7.8.7" - no success

    I had to downgrade "react-scripts" to "3.0.0" for now, thee npm-force-resolutions approach didn't work for me on npm.

    How did you do the downgrade ?

    Just change your package.json to:
    "react-scripts": "3.0.0",

  16. TimKochDev commented on Mar 20, 2020

    @TimKochDev

    The problem is in babel-preset-react-app. For some reason when you install it, it strictly requires @babel/preset-env@7.8.4.

    It looks like it's already updated to require @babel/preset-env@7.8.7 11 days ago in the package.json for babel-preset-react-app.

    I had to use the workaround above combined with using the npm-force-resolutions* package.

    "scripts": {
      "preinstall": "npx npm-force-resolutions",
      ...
    },
    "resolutions": {
      "@babel/preset-env": "^7.8.7"
    }
    

    *Note that this requires a complete package-lock.json with the transitive dependencies that need updating.

    This should only need to be done until the issue outlined above is fixed.

    Edit - Just want to add that I'm able to use react-scripts@3.4.0

    All the suggested solutions did not work until I used preinstall hook! Now it works on localhost and on heroku in production mode.

  17. pinned this issue on Mar 20, 2020
  18. sebastianvz commented on Mar 20, 2020

    @sebastianvz
  19. locked as spam and limited conversation to collaborators on Mar 20, 2020
  20. ianschmitz commented on Mar 20, 2020

    @ianschmitz
    Contributor

    Locking the thread to cut down on the excessive spam. We're actively working to make sure this is resolved. Please be patient.

  21. ianschmitz commented on Mar 20, 2020

    @ianschmitz
    Contributor

    Waiting on babel/babel#11298 to be merged and released then we should be able to bump the versions on our side and release (hopefully!).

    We think #8681 should resolve this without the PR from babel side as we shouldn't encounter that specific scenario here.

  22. added this to the 3.4.1 milestone on Mar 20, 2020
  23. ianschmitz commented on Mar 20, 2020

    @ianschmitz
    Contributor

    Looks like we've fixed in #8661. Will be releasing shortly. Thanks for the patience everyone!

  24. ianschmitz commented on Mar 21, 2020

    @ianschmitz
    Contributor

    This should be fixed in the 3.4.1 release.

    Update react-scripts to 3.4.1 in your package.json file and remove node_modules as well as package-lock.json/yarn.lock and re-install.

    As always we recommend using and committing the package lock file to your repository.

  25. unpinned this issue on Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions