How do you build with parcel 2.9.3

81 views Asked by At

I'm building a react web application with yarn (1.22) and parcel(2.9.3) packages and getting this error in the console:-

Uncaught Error: Could not resolve bundle with id bundle-manifest.js:13 runtime-49a0cc4de56a254e.js:1 in the browser (firefox, chrome)

Anyone solved this issue with parcel build?

App seems to be building fine in azure DevOps.

1

There are 1 answers

0
SiddheshDesai On

In order to resolve your error, Make sure you re-install your packages in your local code and then push the changes in your Azure DevOps repository like below:-

npm i [email protected]
npm i parcel
npm audit fix

My package.json:-

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "@babel/plugin-transform-private-property-in-object": "^7.22.11",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "^5.0.1",
    "swiper": "^10.0.4",
    "web-vitals": "^2.1.4",
    "yarn": "^1.22.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Try updating the npm module and clean the cache :-

npm install -g npm
npm cache clean --force

My Devops build yaml script:-

trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '18.x'
  displayName: 'Install Node.js'

- script: |
    npm install
    npm run build
  displayName: 'npm install and build'

Output:-

enter image description here