ReferenceError while deploying NextJS frontend on Vercel?
I am trying to deploy my website on Vercel but I am facing this error at the build time. This error occurs during preredering of the page ReferenceError: document is not defined at createTag (/vercel/path0/.next/server/chunks/9869.js:151:25622) at /vercel/path0/.next/server/chunks/9869.js:151:38510 at /vercel/path0/.next/server/chunks/9869.js:151:38633 at /vercel/path0/.next/server/chunks/9869.js:151:41458 at /vercel/path0/.next/server/chunks/9869.js:151:25287 at 60496 (/vercel/path0/.next/server/chunks/9869.js:151:25291) at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) at 88924 (/vercel/path0/.next/server/chunks/9869.js:152:58908) at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) at 85912 (/vercel/path0/.next/server/chunks/5708.js:34:11987) Generating static pages (13/18) ReferenceError: document is not defined at createTag (/vercel/path0/.next/server/chunks/9869.js:151:25622) at /vercel/path0/.next/server/chunks/9869.js:151:38510 at /vercel/path0/.next/server/chunks/9869.js:151:38633 at /vercel/path0/.next/server/chunks/9869.js:151:41458 at /vercel/path0/.next/server/chunks/9869.js:151:25287 at 60496 (/vercel/path0/.next/server/chunks/9869.js:151:25291) at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) at 88924 (/vercel/path0/.next/server/chunks/9869.js:152:58908) at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) at 85912 (/vercel/path0/.next/server/chunks/5708.js:34:11987) { digest: '2326889752' } I have this error in all these files: Export encountered errors on following paths: /Contact/page: /Contact /_not-found/page: /_not-found /admin/UnasssignedByWorker/page: /admin/UnasssignedByWorker /admin/reports/page: /admin/reports /admin/verify_worker/page: /admin/verify_worker /login/page: /login /page: / /register/page: /register /user/User_Profile/page: /user/User_Profile /user/create_request/page: /user/create_request /user/hire/page: /user/hire /user/view_request/page: /user/view_request /worker/all_request/page: /worker/all_request /worker/hire/page: /worker/hire /worker/requests/page: /worker/requests Can anyone please tell me what is this error stating and how to resolve it? I have not used the term document in any of the files in which I have this error I am using NextJS version 14.2.8 also I am using the app directory stack overflow link of the questionplease help i am stuck heere

I am trying to deploy my website on Vercel but I am facing this error at the build time. This error occurs during preredering of the page
ReferenceError: document is not defined
at createTag (/vercel/path0/.next/server/chunks/9869.js:151:25622)
at /vercel/path0/.next/server/chunks/9869.js:151:38510
at /vercel/path0/.next/server/chunks/9869.js:151:38633
at /vercel/path0/.next/server/chunks/9869.js:151:41458
at /vercel/path0/.next/server/chunks/9869.js:151:25287
at 60496 (/vercel/path0/.next/server/chunks/9869.js:151:25291)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 88924 (/vercel/path0/.next/server/chunks/9869.js:152:58908)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 85912 (/vercel/path0/.next/server/chunks/5708.js:34:11987)
Generating static pages (13/18)
ReferenceError: document is not defined
at createTag (/vercel/path0/.next/server/chunks/9869.js:151:25622)
at /vercel/path0/.next/server/chunks/9869.js:151:38510
at /vercel/path0/.next/server/chunks/9869.js:151:38633
at /vercel/path0/.next/server/chunks/9869.js:151:41458
at /vercel/path0/.next/server/chunks/9869.js:151:25287
at 60496 (/vercel/path0/.next/server/chunks/9869.js:151:25291)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 88924 (/vercel/path0/.next/server/chunks/9869.js:152:58908)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 85912 (/vercel/path0/.next/server/chunks/5708.js:34:11987) {
digest: '2326889752'
}
I have this error in all these files:
Export encountered errors on following paths:
/Contact/page: /Contact
/_not-found/page: /_not-found
/admin/UnasssignedByWorker/page: /admin/UnasssignedByWorker
/admin/reports/page: /admin/reports
/admin/verify_worker/page: /admin/verify_worker
/login/page: /login
/page: /
/register/page: /register
/user/User_Profile/page: /user/User_Profile
/user/create_request/page: /user/create_request
/user/hire/page: /user/hire
/user/view_request/page: /user/view_request
/worker/all_request/page: /worker/all_request
/worker/hire/page: /worker/hire
/worker/requests/page: /worker/requests
Can anyone please tell me what is this error stating and how to resolve it? I have not used the term document in any of the files in which I have this error I am using NextJS version 14.2.8 also I am using the app directory
stack overflow link of the questionplease help i am stuck heere