DEV Community

Discussion on: How to Disable Server-Side Rendering (SSR) in Next.js

Collapse
 
apkoponen profile image
Ari Koponen

Yes, that is useful. next/dynamic also allows you to send a smaller initial JavaScript bundle to the browser, which is great for performance!

Collapse
 
pranaypratyush profile image
Pranay Pratyush

What's the difference between this method and simply importing my main App component with next/dynamic and passing {ssr: false}?

Thread Thread
 
apkoponen profile image
Ari Koponen

Haven’t tried to do that, so not sure. Using next/dynamic might lead to one additional JS bundle.

Also, if you want multiple entrypoints (like pages/index.js and pages/account.js) you’d need to remember to do the dynamic import in each file separately.

Collapse
 
franklivania profile image
Chibuzo Franklin Odigbo

I tried using next/dynamic, and I am still getting the same errors I am getting in production. The window error.