admin管理员组

文章数量:1378588

I am facing an error when trying to run my Parcel project. The error in the browser console is:

Uncaught Error: Cannot find module '@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js' at newRequire (react-weather-project.f03ac8bf.js:70:19) at newRequire (react-weather-project.f03ac8bf.js:54:18) at localRequire (react-weather-project.f03ac8bf.js:93:35) at newRequire (react-weather-project.f03ac8bf.js:80:24) at react-weather-project.f03ac8bf.js:140:5 at react-weather-project.f03ac8bf.js:159:3

Steps to reproduce:

  1. Installed dependencies using npm install
  2. Started the project using npm start
  3. Error appeared in the console

What I've tried:

  • Cleared Parcel cache & reinstalled dependencies

    rm -rf .parcel-cache node_modules package-lock.json
    npm install
    
  • Reinstalled Parcel

    npm uninstall parcel && npm install --save-dev parcel
    
  • Installed missing module

    npm install --save-dev @parcel/transformer-react-refresh-wrap
    

But the error still occurs.

My environment:

  • OS: Ubuntu 24.04.2 LTS
  • Parcel Version: 2.14.1
  • Node.js Version: 22.12.0
  • npm Version: 11.2.0

package.json:

{
  "name": "react-weather-project",
  "version": "1.0.0",
  "description": "live weather page using react",
  "keywords": [
    "react",
    "live-weather"
  ],
  "homepage": ";,
  "bugs": {
    "url": ";
  },
  "repository": {
    "type": "git",
    "url": "git+.git"
  },
  "license": "ISC",
  "author": "Atul Kumar",
  "type": "module",
  "main": "script.js",
  "scripts": {
    "test": "jest",
    "start": "parcel index.html --port 3000",
    "build": "parcel build index.html"
  },
  "dependencies": {
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-router": "^7.3.0"
  },
  "devDependencies": {
    "parcel": "^2.14.1",
    "process": "^0.11.10"
  }
}

I am facing an error when trying to run my Parcel project. The error in the browser console is:

Uncaught Error: Cannot find module '@parcel/transformer-react-refresh-wrap/lib/helpers/helpers.js' at newRequire (react-weather-project.f03ac8bf.js:70:19) at newRequire (react-weather-project.f03ac8bf.js:54:18) at localRequire (react-weather-project.f03ac8bf.js:93:35) at newRequire (react-weather-project.f03ac8bf.js:80:24) at react-weather-project.f03ac8bf.js:140:5 at react-weather-project.f03ac8bf.js:159:3

Steps to reproduce:

  1. Installed dependencies using npm install
  2. Started the project using npm start
  3. Error appeared in the console

What I've tried:

  • Cleared Parcel cache & reinstalled dependencies

    rm -rf .parcel-cache node_modules package-lock.json
    npm install
    
  • Reinstalled Parcel

    npm uninstall parcel && npm install --save-dev parcel
    
  • Installed missing module

    npm install --save-dev @parcel/transformer-react-refresh-wrap
    

But the error still occurs.

My environment:

  • OS: Ubuntu 24.04.2 LTS
  • Parcel Version: 2.14.1
  • Node.js Version: 22.12.0
  • npm Version: 11.2.0

package.json:

{
  "name": "react-weather-project",
  "version": "1.0.0",
  "description": "live weather page using react",
  "keywords": [
    "react",
    "live-weather"
  ],
  "homepage": "https://github/atul030702/react-liveWeather#readme",
  "bugs": {
    "url": "https://github/atul030702/react-liveWeather/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github/atul030702/react-liveWeather.git"
  },
  "license": "ISC",
  "author": "Atul Kumar",
  "type": "module",
  "main": "script.js",
  "scripts": {
    "test": "jest",
    "start": "parcel index.html --port 3000",
    "build": "parcel build index.html"
  },
  "dependencies": {
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-router": "^7.3.0"
  },
  "devDependencies": {
    "parcel": "^2.14.1",
    "process": "^0.11.10"
  }
}
Share Improve this question edited Mar 19 at 13:50 jonrsharpe 122k30 gold badges268 silver badges476 bronze badges asked Mar 19 at 11:55 Atul SinghAtul Singh 1 1
  • 2 Your post contains several indicators that ChatGPT or another LLM was used to generate it. For a variety of reasons, the use of such generative AI tools is strictly disallowed on Stack Overflow. Please edit your question to remove and replace content that was generated using these tools. – esqew Commented Mar 19 at 12:48
Add a comment  | 

1 Answer 1

Reset to default 0

Yo! to solve this error i removed "main" in package.json and if you encounter "failed to resolve react-router/dom" something like this then add this code below code in your package.json file

"@parcel/resolver-default": {
      "packageExports": true
}

本文标签: