未捕获的类型错误:对象原型可能只是一个对象或空:未定义



当我在开发中运行我的应用程序时,一切都很好,但我们使用"npm run build"构建生产项目,我收到此错误:

2.9b72e8af.chunk.js:sourcemap:1 Uncaught TypeError: Object prototype 
may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at t (2.9b72e8af.chunk.js:sourcemap:1)
at 2.9b72e8af.chunk.js:sourcemap:1
at 2.9b72e8af.chunk.js:sourcemap:1
at Object.<anonymous> (2.9b72e8af.chunk.js:sourcemap:1)
at l ((index):1)
at Object.<anonymous> (2.9b72e8af.chunk.js:sourcemap:1)
at l ((index):1)
at Object.<anonymous> (2.9b72e8af.chunk.js:sourcemap:1)
at l ((index):1)

首先,我收到堆错误,我通过添加以下内容解决了它:

"开始": "反应脚本 --max_old_space_size=4096 启动",

"build": "react-scripts --max_old_space_size=4096 build",

从这篇文章:

如何修复"致命错误:接近堆限制的无效标记压缩分配失败 - JavaScript 堆内存不足"错误

我读过很少有其他帖子像我一样有同样的问题,但没有一个有帮助。

任何建议不胜感激。

不幸的是,这是因为Syncfusion的对话框组件的错误,他们为此提供了一个补丁。

相关内容

最新更新