Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert a BigInt value to a number #48

Closed
uvd opened this issue May 13, 2022 · 1 comment
Closed

Cannot convert a BigInt value to a number #48

uvd opened this issue May 13, 2022 · 1 comment

Comments

@uvd
Copy link
Contributor

uvd commented May 13, 2022

use typescript webapp
develop mode will ok (yarn dev)
but develop production (yarn build)
build result run browser will get

Uncaught TypeError: Cannot convert a BigInt value to a number at Math.pow ()

@wk3368
Copy link
Collaborator

wk3368 commented May 13, 2022

  1. change the browserslist section in your package.json as following:
"browserslist": {
    "production": [
      "chrome >= 67",
      "edge >= 79",
      "firefox >= 68",
      "opera >= 54",
      "safari >= 14"
    ],
    "development": [
      "chrome >= 67",
      "edge >= 79",
      "firefox >= 68",
      "opera >= 54",
      "safari >= 14"
    ]
  },
  1. rm -f node_modules/.cache
  2. yarn build

more details: https://www.suhang.me/blog/detail/creat-react-appcannotconvertabigintvaluetoanumber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants