-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Dynamic imports causes 404 in production #3823
Comments
Could you provide a reproducible repository 🙏 Then we can look into it 👍 |
@paulxuca I also had this problem, dynamic import is working in dev mode but break in production (I could find the output files in @timneutkens here a repo you could reproduce this issue.: https://github.com/Canner/canner-firebase-cms/tree/nextjs Where our CMS component dynamic import: https://github.com/Canner/canner/blob/master/src/components/Generator.js#L153-L159 log in to built file in Loading 404 files in prod server. |
Should be fixed by #4639 |
Currently attempting to deploy a next.js to production with dynamic imports (without using
next/dynamic
since we're importing a non-react library), and running into issues with 404s on the dynamically imported chunks.The built folder structure looks like:
While loading the page, a javascript file at
/_next/webpack/0-cd29260af35981b4adfc.js
is loaded, pointing to the file0-cd29260af35981b4adfc.js
to be in the.next/chunks
directory, which it's not. Moving that file manually to thechunks
folder fixes it. Currently, the request404s
.Expected Behavior
The request for the dynamically loaded javascript file should not 404.
Current Behavior
The request for the dynamically loaded javascript
404s
.Your Environment
The text was updated successfully, but these errors were encountered: