This is what I get when I run npm run build for Nextjs:
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info - Linting and checking validity of types
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data ..TypeError: document.getElementsByTagName is not a function
at we (C:\xampp\htdocs\whatsapp-cloud-frontend\node_modules\emoji-picker-react\dist\emoji-picker-react.cjs.production.min.js:1:157407)
at Object.<anonymous> (C:\xampp\htdocs\whatsapp-cloud-frontend\node_modules\emoji-picker-react\dist\emoji-picker-react.cjs.production.min.js:1:170566)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\xampp\htdocs\whatsapp-cloud-frontend\node_modules\emoji-picker-react\dist\index.js:5:20)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
> Build error occurred
Error: Failed to collect page data for /chat/[username]
at C:\xampp\htdocs\whatsapp-cloud-frontend\node_modules\next\dist\build\utils.js:960:15
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
type: 'Error'
}
info - Collecting page data .
C:\xampp\htdocs\whatsapp-cloud-frontend>
This is what I get when I run
npm run build
forNextjs
: