You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running next build twice will somehow not create the dynamic chunks on the 2nd run. Instead, the pages using the dynamic components (loaded using dynamic(import(…))) will all contain what should be included in the dynamic chunks.
next build, everything runs smoothly, generated bundles are correct.
next build again. The build runs faster thanks to hardsource, but the dynamic chunks are not created, the code from the dynamically imported components is moved to each of the pages using them.
next build again. The build errors with stuff like:
[hardsource:5dfb5712] Could not freeze ./components/dynamic-message.js: Cannot read property 'hash' of undefined
Expected behavior
2 sequential build should create the same bundles.
System information
OS: macOs
Version of Next.js: 7.0.0
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
Running
next build
twice will somehow not create the dynamic chunks on the 2nd run. Instead, the pages using the dynamic components (loaded usingdynamic(import(…))
) will all contain what should be included in the dynamic chunks.Running a 3rd time makes the build fail.
To Reproduce
The issue is easily reproducible with the following repository: https://github.com/tusbar/next-js-dynamic-issue
rm -rf node_modules/.cache
next build
, everything runs smoothly, generated bundles are correct.next build
again. The build runs faster thanks to hardsource, but the dynamic chunks are not created, the code from the dynamically imported components is moved to each of the pages using them.next build
again. The build errors with stuff like:Expected behavior
2 sequential build should create the same bundles.
System information
The text was updated successfully, but these errors were encountered: