vite+react+antd3 错误
#12337
Replies: 3 comments 4 replies
-
|
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Easiest solution, add this to HTML as a global polyfill <script>
if (typeof window !== 'undefined') {
window.global = window
}
</script> |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
767339608
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
用vite+react +antd3 引用会报错 提示global不存在
因为是老项目所有 无法更新antd 想用vite 重构
如果直接在define中引入global的话是可以解决报错但是打包会提示global不存在
这边有什么好的解决办法嘛
https://stackblitz.com/edit/vitejs-vite-3yjnht?file=package.json
Suggested solution
无
Alternative
No response
Additional context
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions