4

I am currently transferring a site from React-Fuse to NextJS with React. 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

modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

modules[moduleId] is undefined.

I've tried every fix I can find online and nothing seems to be working, any help is appreciated

babelrc is :

{
 "presets": ["next/babel"]
}

next.config has nothing pertaining to webpack, only some redirects

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.

asked Mar 16, 2021 at 23:55

3 Answers 3

6

Try to clean your ".next" folder and run npm install again.

answered Jan 21, 2022 at 16:46
Sign up to request clarification or add additional context in comments.

Comments

2

Delete your .next folder and run npm install. If it gives error due to version, then run npm install --force

answered Jul 12, 2023 at 9:53

Comments

0

just delete your .next build folder , node_modules folder and lock.yaml file .

Then rerun the installation script e.g: pnpm install ( Note :based on your package manager you use in your project) .

hope it will work.

answered Feb 2, 2024 at 7:30

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.