Next.js Discord

Discord Forum

one of my deps is using 'document' which is triggering issues on production. How to solve it?

Answered
West African Lion posted this in #help-forum
Open in Discord
Avatar
West African LionOP
Hi one of my deps is using 'document' which is not making my Next.js production app happy.
I know how to deal with 'document' and 'window' on my side. I have a spectrum of choices.
But how to deal with a dependency which is not ready for ssr?
Like game framework based on canvas?

Thanks,

MM
Answered by Alfonsus Ardani
use dynamic() with ssr:false to skip SSR
View full answer

3 Replies

Avatar
use dynamic() with ssr:false to skip SSR
Answer
Avatar
West African LionOP
Thank you!