The Wayback Machine - https://web.archive.org/web/20201110152955/https://github.com/vercel/next.js/issues/18556
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 Imports require SSR: true flag for Next Export #18556

Open
conanbatt opened this issue Oct 30, 2020 · 1 comment
Open

Dynamic Imports require SSR: true flag for Next Export #18556

conanbatt opened this issue Oct 30, 2020 · 1 comment

Comments

@conanbatt
Copy link

@conanbatt conanbatt commented Oct 30, 2020

Bug report

The ssr flag in dynamic imports does not match the developer usage of the framework.

Describe the bug

This might be a documentation issue, implementational issue or simply API signature, but it is unexpected for next export websites to require ssr: true for dynamic imports. If set to false, it works in dev but not in export.

To Reproduce

Repo: https://github.com/conanbatt/nextjs-dynamic-imports-export

Expected behavior

As a developer I expect a dynamic import with ```ssr: false`` to work in next export, as it is a non-ssr deployment of the app.

System information

  • Version of Next.js: [e.g. 9.5.3]]

Additional context

Looking at the tests for next export, it seems to use SSR to render the pages, but this causes a mismatch of understanding between how the app is deployed and how it is generated.

Solutions?

1- Make ssr flag work as the intended behavior (albeit it could break API?)
2- Improve documentation on dynamic import AND/OR next export to describe this issue
3- Add additional flag to dynamic imports to handle this case.

@timneutkens timneutkens added this to the 10.x.x milestone Nov 2, 2020
@timneutkens
Copy link
Member

@timneutkens timneutkens commented Nov 2, 2020

Marked as bug (did not verify it's actually a bug though) but what you're describing sound unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.