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

vite打包后部署ng运行访问报错 #1207

Open
guoqirong opened this issue May 5, 2023 · 7 comments
Open

vite打包后部署ng运行访问报错 #1207

guoqirong opened this issue May 5, 2023 · 7 comments
Assignees

Comments

@guoqirong
Copy link

guoqirong commented May 5, 2023

1.依赖仓库的版本(Dependencies versions)

  • react:18.2.0
  • form-render:2.1.8
  • fr-generator: 2.8.4
  • antd:4.x

2.问题描述(Bug description)
本地运行正常,构建打包后部署到ng上访问报以下错误
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED')
at react-dom-0dffd31f.js:9:5345
image

3.最小复现 demo(Reproduction demo)
https://github.com/guoqirong/react-vit-demo

@guoqirong guoqirong changed the title vite打包后报错,ng运行访问报错 vite打包后部署ng运行访问报错 May 5, 2023
@lhbxs lhbxs assigned MoYuM and unassigned lhbxs May 5, 2023
@MoYuM
Copy link
Collaborator

MoYuM commented May 6, 2023

你的 demo,我把 form render 和 fr generator 都注释掉之后再打包依然没法跑起来。我怀疑这是 vite 或者 vite-qiankun 导致的问题。你试试在你的实际项目中去掉 form render 和 fr generator 之后能正常部署么?

@guoqirong
Copy link
Author

要把form render 和 fr generator移除掉就是正常的,安装了任何一个就不能运行了

@xiaoyao1114
Copy link

将vite.config.ts 静态资源分类打包部分去掉。就没问题了

@lisisi1997
Copy link

你的vite版本是多少? 我遇到相同问题,同事通过将vite版本升级到4.1.4解决了

@guoqirong
Copy link
Author

guoqirong commented May 25, 2023

vite是4.1.4版本,需要去掉静态资源分类打包配置,这两个组件分类打包会有问题
image

@persomLing
Copy link

也是部署后,一模一样的报错

@lisisi1997
Copy link

lisisi1997 commented Jan 18, 2024 via email

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

6 participants