Next.js Discord

Discord Forum

Deploying to Vercel giving reference error

Unanswered
_lts_ posted this in #help-forum
Open in Discord
I have been trying to deploy my Next.js app on Vercel but the build fails always stating a ReferenceError: window is not defined. Initially the error was coming from the apex-chart package I was using and after going through the Next.js docs, I had to use dynamic imports to resolve the issue. The error for the package was fixed but another ReferenceError popped up and I am unable to trace where it's coming from. Below is a screenshot of the log errors. Any help is much appreciated. Thank you.

0 Replies