-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
π bug report
When attempting to start the development server on a Parcel + React V17 project recipe that was working fine for some time, the server fails to start with an error regarding the @babel/core module.
$> npx parcel src/index.html
...
@parcel/package-manager: Could not find module "@babel/core", but it was listed in package.json. Run your package manager first.π Configuration (.babelrc, package.json, cli command)
Sample package.json with React 17 recipe
{
"devDependencies": {
"@babel/core": "^7.28.5",
"@emotion/babel-plugin": "^11.13.5",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"flow-bin": "^0.290.0",
"parcel": "^2.16.1",
"prettier": "3.6.2",
"typescript": "^5.9.3"
},
"dependencies": {
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
"@emotion/is-prop-valid": "^1.1.2",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@parcel/config-default": "^2.16.1",
"@parcel/transformer-svg-react": "^2.16.1",
"@testing-library/react": "^12.1.5",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"framer-motion": "^4.1.17",
"postcss": "^8.4.20",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.4",
"tailwindcss": "^3.4.17"
}
}
Babel Configuration (.babelrc)
{
"plugins": ["@emotion/babel-plugin"]
}π€ Expected Behavior
Starting Parcel Development server via npx parcel serve src/index.html should start the project successfully without error.
π― Current Behavior
Parcel Development server fails to start with error related to @babel/core being present in package.json but not installed.
β developer.local-react17 git:(master) β npx parcel src/index.html
π¨ Build failed.
@parcel/package-manager: Could not find module "@babel/core", but it was listed in package.json. Run your package manager first.
/private/tmp/public_html_tester/developer.local-react17/package.json:12:5
11 | "devDependencies": {
> 12 | "@babel/core": "^7.28.5",
> | ^^^^^^^^^^^^^ Defined here, but not installed
13 | "@types/react": "^19.2.2",
14 | "@types/react-dom": "^19.2.2",
@parcel/reporter-dev-server: Could not shutdown devserver because it does not exist.
...
...π Possible Solution
Possible version mismatch with Parcel? Should an older version of Parcel or another library be used?
π¦ Context
This React V17 build recipe has been stable and exists as apart of an automated build script that is executed as a backend job. The recipe was stable for some time only recently when attempting to QA test the build recipe the error with Babel was encountered.
π Your Environment
- MacOS Big Sur 11.7.10
- Node v18.20.8 (Could this deprecated version of node be responsible?)