Error occurred prerendering page
Unanswered
Yellow croaker posted this in #help-forum
Yellow croakerOP
Hello guys I have been getting this error when I deploy my project to vercel, but weirdly enough when I do
Error occurred prerendering page "/login". Read more: https://nextjs.org/docs/messages/prerender-error
ReferenceError: document is not defined
at createTag (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:4144)
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:17032
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:17155
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:19980
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:3809
at 8419 (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:3813)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at 1595 (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:327589)
at Object.t [as require] (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at require (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:131:7165)
Export encountered an error on /(Auth)/login/page: /login, exiting the build.
⨯ Static worker exited with code: 1 and signal: null
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
yarn build
the build is successful. Does anyone knows how to solve this and deploy it?Error occurred prerendering page "/login". Read more: https://nextjs.org/docs/messages/prerender-error
ReferenceError: document is not defined
at createTag (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:4144)
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:17032
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:17155
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:19980
at /vercel/path0/.next/server/app/(Auth)/login/page.js:1:3809
at 8419 (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:3813)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at 1595 (/vercel/path0/.next/server/app/(Auth)/login/page.js:1:327589)
at Object.t [as require] (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at require (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:131:7165)
Export encountered an error on /(Auth)/login/page: /login, exiting the build.
⨯ Static worker exited with code: 1 and signal: null
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1