Skip to content
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 import request 404 in production mode #2073

Closed
davidnguyen11 opened this issue May 26, 2017 · 8 comments
Closed

dynamic import request 404 in production mode #2073

davidnguyen11 opened this issue May 26, 2017 · 8 comments
Assignees

Comments

@davidnguyen11
Copy link
Contributor

Hi guys,

I made a demo to display news from API & using a new feature dynamic import. While in development mode it works well. But in production mode, some components were not loaded successfully. Here is a repo
https://github.com/nndung179/next.js/tree/feature/refactor_layout_with_material_ui

@arunoda
Copy link
Contributor

arunoda commented May 28, 2017

@nndung179 yes. This is a bug.
I can see what's happening here.

In the production mode, due to code splitting, the module is moved to the app.js. So, there's nothing to live inside the dynamic component. So, that's empty.

That's why this cause an error.
We need to fix this.

@arunoda
Copy link
Contributor

arunoda commented May 28, 2017

As a fix for now, do not try to import a module both via dynamic import and normal import.

@davidnguyen11
Copy link
Contributor Author

@arunoda @timneutkens I just tested in version 3.0.0-beta11. But it still happens

@cdock1029
Copy link
Contributor

@nndung179 The fix is merged in master but not part of version 3.0.0-beta11. I imagine it will be in beta12, which isn't pushed yet.

@davidnguyen11
Copy link
Contributor Author

Thank @cdock1029. Yes I hope it will be there soon.

@arunoda
Copy link
Contributor

arunoda commented Jun 9, 2017

@nndung179 @cdock1029 try the latest beta: 3.0.0-beta12

@davidnguyen11
Copy link
Contributor Author

davidnguyen11 commented Jun 9, 2017

@arunoda just try it. It worked!!!. Thank @arunoda

@arunoda
Copy link
Contributor

arunoda commented Jun 9, 2017

Nice.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants