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
I have a Next 12 application that after a very simple upgrade to Next 14 or Next 15 started having a very weird behaviour using dev mode.
the main point of the application is a component that given a certain key renders a certain component. These components are dynamically loaded through the dynamic import.
This will then be rendered in the application in this way
constComponent=registry[key];return<Component/>
In a Next 12 application this is running without a flaw.
With Next 14 the build passes but dev mode always causes an error while hydrating. If I minimize the error the application works fine but it seems Next.js is having trouble hydrating.
With Next 15 the build also passes but dev mode does not cause an error but instead starts refreshing (maybe HMR?) in a loop until the browser tab crashes.
I've troubleshooted the application and came to the conclusion that it's the dynamic imports. Without them, the rest of the app runs fine. I've also troubleshooted the contents of the components and the content does not seem to matter. I tried a dummy component that just returns an <h1>hello world</h1> and the same thing happens.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
I have a Next 12 application that after a very simple upgrade to Next 14 or Next 15 started having a very weird behaviour using dev mode.
the main point of the application is a component that given a certain key renders a certain component. These components are dynamically loaded through the dynamic import.
This will then be rendered in the application in this way
In a Next 12 application this is running without a flaw.
With Next 14 the build passes but dev mode always causes an error while hydrating. If I minimize the error the application works fine but it seems Next.js is having trouble hydrating.
With Next 15 the build also passes but dev mode does not cause an error but instead starts refreshing (maybe HMR?) in a loop until the browser tab crashes.
I've troubleshooted the application and came to the conclusion that it's the dynamic imports. Without them, the rest of the app runs fine. I've also troubleshooted the contents of the components and the content does not seem to matter. I tried a dummy component that just returns an
<h1>hello world</h1>
and the same thing happens.Can anyone provide any pointers?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions