We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
新建的项目,修改文件热更新,页面卡住,且报错 Uncaught ReferenceError: process is not defined
正常热更新
https://github.com/Faithree/bug-demo
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
值得注意是的百分之二十的问题都可以用重装依赖来解决,所以你可以尝试一下: 删除 'node_modules' 文件夹 -> 删除 'package-lock.json'或 'pnpm-lock.yaml' 文件 -> 运行 'pnpm install' 或 'npm install' 命令
根据你提供的信息,这个问题可能是因为缺少了引入 process 的配置。下面是一个可能的解决方案:
process
.umirc.local.js
export default { define: { 'process.env': {}, }, };
这个解决方案使用了 Umi 的 define 配置来指定 process.env 是一个空对象,以解决 process is not defined 的报错。这样热更新应该能够正常工作了。
process.env
process is not defined
关于页面卡住问题,这可能是因为热更新过程中编译时间过长导致的。你可以尝试做一些前端性能优化,例如使用代码分割、按需加载等技术来减少页面加载时间,从而提升整体的性能。另外,你还可以使用 webpack-bundle-analyzer 工具来分析打包结果,找出页面卡住的具体原因。
参考这个我解决了 https://blog.zhouweibin.top/pitfall/react-hot-error/
No branches or pull requests
🐛 bug 描述
新建的项目,修改文件热更新,页面卡住,且报错 Uncaught ReferenceError: process is not defined
📷 复现步骤 | Recurrence steps
🏞 期望结果 | Expected results
正常热更新
💻 复现代码 | Recurrence code
https://github.com/Faithree/bug-demo
© 版本信息
🚑 其他信息
The text was updated successfully, but these errors were encountered: