[英]Build errors in NextJS in __webpack_require__
I am currently transferring a site from React-Fuse to NextJS with React.我目前正在使用 React 将站点从 React-Fuse 转移到 NextJS。 Mostly everything is working fine, but upon trying to create a build there is an error that I cannot get around:大多数情况下一切正常,但是在尝试创建构建时,出现了一个我无法解决的错误:
> Build error occurred
TypeError: Cannot read property 'b' of undefined
is thrown in every build, it is coming from the __webpack_require__
function at在每个构建中抛出,它来自__webpack_require__
function 在
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
modules[moduleId]
is undefined. modules[moduleId]
未定义。
I've tried every fix I can find online and nothing seems to be working, any help is appreciated我已经尝试了我可以在网上找到的所有修复程序,但似乎没有任何效果,感谢任何帮助
babelrc is: babelrc 是:
{
"presets": ["next/babel"]
}
next.config has nothing pertaining to webpack, only some redirects next.config 与 webpack 无关,只有一些重定向
Pages are written as follows:页面编写如下:
import SomePage from 'components/aPage/SomePage'
import { connect } from 'react-redux'
import * as AuthActions from 'auth/store/actions'
function mapDispatchToProps(dispatch) {
...
}
function mapStateToProps({ user, bank }) {
...
}
export default connect(mapStateToProps, mapDispatchToProps)(SomePage)
with the actual jsx file being imported and then connected to the store.导入实际的 jsx 文件,然后连接到商店。
Try to clean your ".next" folder and run npm install
again.尝试清理您的“.next”文件夹并再次运行npm install
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.