3

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

Hyyan Abo Fakher
  • 3,497
  • 3
  • 21
  • 35
David
  • 539
  • 3
  • 9
  • 23
  • 1
    Does this answer your question? [How to convert BigInt to Number in JavaScript?](https://stackoverflow.com/questions/53970655/how-to-convert-bigint-to-number-in-javascript) – Hyyan Abo Fakher Jul 28 '22 at 08:02
  • These are gargantuan numbers, why do you want to deal with them as a number? – Mina Jul 28 '22 at 08:03
  • hi @HyyanAboFakher thank you for your response, but the error is generating from npm package which we cannot edit it, for the same I've update screenshot as well – David Jul 28 '22 at 08:04
  • @Mina I'm not doing anything here, I don't even know why I'm getting this error on npm build command – David Jul 28 '22 at 08:06

1 Answers1

3

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

Alchemist
  • 325
  • 1
  • 17