-
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
"Did not expect server HTML to contain [..]" during dynamic import #6904
Comments
It seems like the only way around this is to make sure all imports in the module you loaded dynamically are also wrapped in |
Having the same issue. Hard to pinpoint the problem but it looks like it fails when trying to import something outside its bundle. ¯_(ツ)_/¯ |
This comment has been minimized.
This comment has been minimized.
Note that it's a bad idea to suppress hydration warnings. It will hide problems in your application. |
I'm having the same issue, is this something new to next 8? |
Just tried downgrading my project to next 7, and it fixes the issue. This is happening to me in dev mode, in production seems to be working fine on both 7 and 8. |
Can you try |
I have done that previously, is something recently released? |
Yep I think @Timer landed a patch for next/dynamic, not entirely sure if it's directly related, but doesn't hurt to try. |
I confirmed this was fixed by my PR, upgrading to the latest canary will fix this. |
Bug report
Describe the bug
Dynamic import of components with "re-export" by
index.js
file leads to following warnings:Warning: Did not expect server HTML to contain a <h2> in <div>.
To Reproduce
index.js
withexport { default } from './World'
development
mode withyarn dev
/npm run dev
.Here is example repository: https://github.com/oMatej/next-dynamic-import-issue
Expected behavior
Both types of imports should behave the same.
System information
The text was updated successfully, but these errors were encountered: