Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Conversion from 'BigInt' to 'number' is not allowed on react build script

I've developed UI using create-react-app. UI is working fine with the normal npm start command, but when I build the UI with npm run build it's throwing the error `Conversion from 'BigInt' to 'number' is not allowed

I didn't get many related solutions to my problem on google. Can someone help please ?

My Package.json

{
  "name": "erp-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.15",
    "@popperjs/core": "^2.10.2",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.22.0",
    "bootstrap": "^5.0.1",
    "font-awesome": "^4.7.0",
    "jsontokens": "^3.1.1",
    "react": "^17.0.2",
    "react-datepicker": "^4.8.0",
    "react-dom": "^17.0.2",
    "react-hook-form": "^7.17.0",
    "react-paginate": "^7.1.3",
    "react-router": "^5.2.1",
    "react-router-dom": "^5.3.0",
    "react-scripts": "^4.0.3",
    "react-toastify": "^8.0.3",
    "web-vitals": "^1.1.2"
  },
  "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"
    ]
  }
}

Error screenshot which is point in browser enter image description here

like image 732
David Avatar asked Sep 16 '25 04:09

David


1 Answers

Please try this.

In your package.json.

"browserslist": {
    "production": [
      "chrome >= 67",
      "edge >= 79",
      "firefox >= 68",
      "opera >= 54",
      "safari >= 14"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }

Don't know what is the root cause but it will works. It comes from here

like image 85
Alchemist Avatar answered Sep 17 '25 20:09

Alchemist