Skip to content

Parcel + React V17 project could not find module @babel/coreΒ #10236

@e2corporation

Description

@e2corporation

πŸ› 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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions