[build] 에러 Cannot convert a BigInt value to a number 해결
본문 바로가기

Frontend/React

[build] 에러 Cannot convert a BigInt value to a number 해결

개발할때는 문제없었는데 빌드를 하고난후에 확인해보니 Cannot convert a BigInt value to a number에러가 나서 화면이 보이질않았다.

package.json에서 browserslist의

production모드(배포) 버전을 손보니까 해결됨

 

browserslist 속성은 브라우저 및 버전을 설정하는데 사용되는 속성으로 주로 css전처리기(예: Autoprefixer)나 Javascript 번들러(예: Babel)에서 사용되어 해당 프로젝트를 지원하는 브라우저 범위를 설정합니다. 

 

수정전

배포버전에서는 지원이 중단되지않은 브라우저 중에서 사용률이 0.2% 이상인 브라우저만 지원하겠다는 의미이고

개발버전에서는 크롬,파이어폭스,사파  최신버전들만 지원하겠다는 의미

  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },

 

수정후

"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"
    ]
  }

 

https://github.com/paulmillr/noble-ed25519/issues/23

 

Uncaught TypeError: Cannot convert a BigInt value to a number · Issue #23 · paulmillr/noble-ed25519

Using this with typescript / react-scripts, I am getting an error in the production / transpiled code (even though it works in my dev version). "use strict"; /*! noble-ed25519 - MIT License (c) Pau...

github.com

 

반응형

'Frontend > React' 카테고리의 다른 글

React에서 .env-cmdrc 안먹을때  (0) 2023.07.18
[env-cmd] 리액트 env 사용방법  (0) 2023.06.26
useReducer 복잡한 상태관리 로직분리  (0) 2023.04.07
Context API 사용법  (0) 2023.04.06
React jsx안에서 `${}`쓰고싶을때  (0) 2023.03.27