pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] build 之後出現錯誤 Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'),網站無法執行

Open mukiwu opened this issue 1 year ago • 2 comments

🐛 bug 描述

開發時一切正常,而我使用 npm run build 之後,沒有出現錯誤,

但是瀏覽網站時是白畫面,出現錯誤:

react-dom-4011441e.js:9 Uncaught TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED')
    at react-dom-4011441e.js:9:230
    at react-dom-4011441e.js:139:612

📷 复现步骤

反覆測試後,我的 jsx 檔案只要引入 pro-components 就會出現上面的錯誤

// 引入組件就會出現問題,但開發時一切正常
import { ProCard, ProTable } from '@ant-design/pro-components'

🏞 期望结果

希望能順利瀏覽網站

💻 复现代码

// 引入組件就會出現問題,但開發時一切正常
import { ProCard, ProTable } from '@ant-design/pro-components'

© 版本信息

  • ProComponents 版本: 2.6.46
  • ant design 版本:5.3.0
  • vite 版本:4.1.0 (使用 vite + react)
  • node 版本:21.6.0 (試過 v17.0.1 也是錯)
  • 浏览器环境:Chrome 版本 120.0.6099.216
  • 开发环境 mac OS

🚑 其他信息

截圖 2024-01-18 15 12 11

mukiwu avatar Jan 18 '24 07:01 mukiwu

以下的 Issues 可能会帮助到你 / The following issues may help you

  • [#7697][🐛[BUG] ant的V4.24.5版本和procomponentsV2.6.18版本放到一个项目内的时候,引入ProDescription,会报 cannot read properties Of undefined (reading 'useToken')][62%]

github-actions[bot] avatar Jan 18 '24 07:01 github-actions[bot]

是不是你的 react 和 react-dom 版本没对上?

ONLY-yours avatar Jan 18 '24 08:01 ONLY-yours