Next.js Discord

Discord Forum

Dynamic import only works on client page

Unanswered
arig4m3r posted this in #help-forum
Open in Discord
Hello, I'm creating a route that should import a client component dynamically, when trying to get this to work, I found out a strange behavior, next/dynamic seems to only be working on client side components, not at all on servers.

Server First Load JS: 430 kB
Client First Load JS: 79.7 kB

6 Replies

Lazy loading applies to Client Components.
@European sprat Lazy loading applies to Client Components.
Yes, but look "Importing Server Components", it has no "use client" at all
European sprat
ah yeah i see that, i'm not sure then
@arig4m3r Yes, but look "Importing Server Components", it has no "use client" at all
What i think that examples shows: It uses a server component to import another server component and optimizes the clients components within this component
@European sprat ah yeah i see that, i'm not sure then
Ok, it's fine, thanks anyway ^^