babel.loadPartialConfigSync is not a function
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.)
Have the same problem.
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
same error
same here
same here
same here
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,
Hi any update on this ? I am getting similar issue
@tarumam solution worked! :) Thanks
I had to upgrade mine from version 7.6.4 to 7.21.0.
I'm guessing the function was added sometime between
same here. I'm guessing it would appear in some versions? anyway, @mattdell solution worked! Thanks
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