create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

babel.loadPartialConfigSync is not a function

Open vinay-athiyil opened this issue 4 years ago • 12 comments

Describe the bug

I have upgraded react-scripts package to latest 5.0.0. While running 'npm run build' got following error:

src/store.js
  Line 0:  Parsing error: babel.loadPartialConfigSync is not a function


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

npm ERR! A complete log of this run can be found in:

Did you try recovering your dependencies?

#npm --version
6.14.15

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

# npm --version
6.14.15
# npx create-react-app --info
npx: installed 67 in 4.61s

Environment Info:

  current version of create-react-app: 5.0.0
  running from /root/.npm/_npx/18603/lib/node_modules/create-react-app

  System:
    OS: Linux 4.18 CentOS Linux 8
    CPU: (2) x64 AMD EPYC 7571
  Binaries:
    Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node
    Yarn: Not Found
    npm: 6.14.15 - ~/.nvm/versions/node/v14.17.1/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^16.13.1 => 16.14.0 (0.14.10, 15.7.0, 0.9.0)
    react-dom: ^16.13.1 => 16.14.0
    react-scripts: 5.0.0 => 5.0.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

Expected behavior

(Write what you thought would happen.)

Actual behavior

(Write what happened. Please add screenshots!)

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

vinay-athiyil avatar Dec 29 '21 08:12 vinay-athiyil

Have the same problem.

ruslanzakh avatar Jan 28 '22 09:01 ruslanzakh

I have the same problem, I get these warnings when running npm start:

src\components\common\constants.js
  Line 0:  Parsing error: babel.loadPartialConfigSync is not a function

nimsilva avatar Mar 03 '22 15:03 nimsilva

same error

hugoerortiz avatar Mar 24 '22 21:03 hugoerortiz

same here

tarumam avatar Mar 27 '22 22:03 tarumam

same here

jccalbuquerque avatar Mar 28 '22 21:03 jccalbuquerque

same here

capndave avatar Apr 12 '22 20:04 capndave

Guys... that worked for me: 1 - installed the latest @babel/core then my error changed to: This experimental syntax requires enabling one of the following parser plugin(s): "jsx", "flow", "typescript".

2 - Updated my babel.config.js

module.exports = {
  presets: ["@babel/preset-env", "@babel/preset-react"],
};

3 - On ESLint Config:

 parser: @babel/eslint-parser,

tarumam avatar Apr 12 '22 20:04 tarumam

Hi any update on this ? I am getting similar issue

ghost avatar May 16 '22 06:05 ghost

@tarumam solution worked! :) Thanks

AugusteTomaseviciute avatar Jul 08 '22 12:07 AugusteTomaseviciute

I had to upgrade mine from version 7.6.4 to 7.21.0.

I'm guessing the function was added sometime between

mattdell avatar Mar 13 '23 12:03 mattdell

same here. I'm guessing it would appear in some versions? anyway, @mattdell solution worked! Thanks

hlhygr avatar Oct 29 '23 08:10 hlhygr

I encountered this problem while maintaining an old project, what I did was to upgrade @babel/core to the latest version, which is currently 7.25.2

JontyyYang avatar Jul 30 '24 12:07 JontyyYang