admin管理员组文章数量:1122832
I'm getting the error
22.93 [Error: require() of ES Module file:///app/node_modules/react/index.js not supported.] {
22.93 code: 'ERR_REQUIRE_ESM'
22.93 }
22.93
22.93 > Build error occurred
22.93 Error: Failed to collect page data for /dashboard
22.93 at <unknown> (/app/node_modules/next/dist/build/utils.js:1234:15) {
22.93 type: 'Error'
22.93 }
where this is my index.js in the react module
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
}
I'm unsure how to go about this as i've seen many similar errors online but it was associated with other modules and not react.
Any help would be appreciated!
本文标签: reactjsrequire() of ES Module fileappnodemodulesreactindexjs not supportedStack Overflow
版权声明:本文标题:reactjs - require() of ES Module file:appnode_modulesreactindex.js not supported - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309376a1933998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论