-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
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
Cannot read property 'pop' of undefined #10161
Comments
Both Node 8 and 9 are no longer supported (not by Next.js, but in general). They reached their official end of life. Please try using Node 10, 12 or 13. |
Closing as Node 8 is EOL as mentioned above. Please upgrade to Node 10 or newer. |
I just tested it using node |
node v10.16.0 - the same error only thing that helped is adding
in my next.config.js |
I confirmed this error on node v12.13.1 and @ivadimko 's fix solved this error, but created full white pages for all routes. My |
Can someone provide a reproducible demo? Otherwise we cannot look into/fix this. |
@Timer I've got a massive private repo of which we cannot easily isolate the area of issue. I'll have to rely on someone else to provide a reproducible demo. UPDATE: I fixed this bug entirely by doing a |
@dawsbot it's unlikely someone will come along to provide a reproduction as you're already the 3rd person to report without providing one. |
@timneutkens I hear you. What's the best way to take part in the open-source community here with a public example when I'm working on a private proprietary project covered by an NDA? I don't actually know what options exist here; I'm open to suggestions. |
Spending time figuring out where what causes the issue would be one way. Another would be sharing the project under NDA, though generally we only look at projects under enterprise support as it takes significantly more time. |
Thank you for the explanation of the options here @timneutkens 🙌 I won't be building a reproducible example. Seems best to put this plainly. Thanks for a great tool, I'll be using this for years to come! |
I'm trying to reproduce it https://github.com/muhaimincs/nextjs-css-error but turn out another error appear |
My PR #10171 has been closed so let's continue discussion here. Unfortunately, I can't provide reproducible demo for the moment. Error happened in big private project. We use styled components there but tried to work with css-modules as better solution. Anyway, thank you for such a great tool. We're very happy by using it. |
@ivadimko We also use |
What version of |
@Timer my version of |
Hello everyone. We've managed to create a minimal reproducible demo of this bug with a closed-source example graciously provided by someone. 🙏 We've narrowed the issue down to This plugin appears to not account for an edge-case webpack produces under our new chunking configuration. For reference, the same code that errors with We will file a bug with Unfortunately, since this is not a bug with Next.js, there are no instructions we can give to fix this until it's resolved upstream. Reduced reproduction: |
Addressing the issue now. Will update both threads |
does anyone tried this? |
@Timer i did research, based on your bug showcase branch, and posted what i found in mini-css-extract-plugin issue, that discuss dynamic imports - webpack-contrib/mini-css-extract-plugin#341 (comment) |
@Timer We also have this error in our project (next.js 9.3.6, without extract-css-chunks-webpack-plugin). |
Well if we are to fix that problem (and that's NOT nextjs problem), we need the most simpliest way to reproduce bug, cause my reasoning "that works" doesnt work that good for them. |
Hi,every body, I solved this question by here , in this way, you need to found if (!success) {
// no module found => there is a conflict
// use list with fewest failed deps
// and emit a warning
if (!bestMatch) {
break;
}
const fallbackModule = bestMatch.pop();
usedModules.add(fallbackModule);
}
} add this line in there if (!bestMatch) {
break;
} |
@pavelzubov try my fix (see above), and check if it builds with dynamic imports. It is not guaranteed that nextjs is not buggy here |
any news about this? |
This solution works for |
I found the solution by combine the solution with this comment: webpack-contrib/mini-css-extract-plugin#341 (comment) In my next.config.js under webpack(config)
I hope this will solve issue for whoever runs into it. |
finally actually great solution, unlike my hack with !bestMatch break. Tried it - fixed my issues. |
This workd in yarn build, but broke yarn dev. To fix this I used:
|
I got the |
Hello, you way works for me. But I have athother question. If other member clone my project. Does he write this code in node_modules ? |
I'm adding additional lines if (NODE_ENV === "production" && config.optimization.splitChunks) {
config.optimization.splitChunks.cacheGroups.shared.enforce = true;
config.optimization.splitChunks.cacheGroups.commons.enforce = true;
} solve my issues. |
Mine as well. I'm using the latest of all packages and I got this error everywhere now. |
this line surely fixed the problem, my node's version is v10.15.3 |
This comment has been minimized.
This comment has been minimized.
Hi, every body! In last time problem was solved with removing from scss styles line with transition
I don't know how it can be related, but after deleting this line from scss file - error is disappeared |
@urffin might be related. I've checked my files and the problem was also related to that. This is the final fix: module.exports = {
webpack: (config) => {
if (
process.env.NODE_ENV === "production" &&
config.optimization.splitChunks
) {
config.optimization.splitChunks.cacheGroups.shared.enforce = true;
config.optimization.splitChunks.cacheGroups.commons.enforce = true;
}
return config;
}
}; |
Sad, but this fix work just for my local computer, but still fail on CI, i mean error still reproduce even when this fix added. And solved just after fixing styles in some components. |
Thank you for the solution, But this will make the packaging volume larger. |
A word of caution, the solution below broke several pages/components in production (but not in development so it initially looked like it was workig)
The solution below seems to have fixed the issue for me without affecting production:
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
next build
failed after upgrade to 9.2.0Expected behavior
Build success
System information
The text was updated successfully, but these errors were encountered: