Next.js Discord

Discord Forum

High first load even though I'm using Dynamic Import

Answered
Gull-billed Tern posted this in #help-forum
Open in Discord
Gull-billed TernOP
const DynamicMapBox = dynamic(() => import('./Mapbox/Mapbox'), { ssr: false });


I'm using the dynamic import as shown above. Inside this component I'm using a huge npm package, which I don't want to have in my first load bundle because it's ~300kb. What can I possible do wrong implementing this? Because even with this dynamic import my first load JS is too high. I don't think its working correctly
Answered by Gull-billed Tern
Fixed it myself: by adding 'use client' on top of the page
View full answer

1 Reply

Gull-billed TernOP
Fixed it myself: by adding 'use client' on top of the page
Answer