TypeError: Cannot read properties of null (reading 'useContext') Next js npm run build error solved

preview_player
Показать описание
Generating static pages (0/5) [== ]Error: Html should not be imported outside of pages/_document.

TypeError: Cannot read properties of null (reading 'useContext')

next js
npm run build error

set NODE_ENV=production & next build
Рекомендации по теме
Комментарии
Автор

Thank you.. You saved me :) Happy coding

ryzenop
Автор

Please how fix it :
TypeError: Cannot read properties of undefined (reading 'productsModel')
at exports.getHome
at Layer.handle [as handle_request]
at next
at Route.dispatch
at Layer.handle [as handle_request]
at
at Function.process_params
at next
at Function.handle
at router
TypeError: Cannot read properties of undefined (reading 'productsModel')
at exports.getHome
at Layer.handle [as handle_request]
at next
at Route.dispatch
at Layer.handle [as handle_request]
at
at Function.process_params
at next
at Function.handle
at router

heshamzero-yl
Автор

well didnt worked for me and im using M2 mac tho if ur wondering about the OS and all

mukhilanelangovan
Автор

thanks for your video, unfortunately it didnt worked for me😥

fkjosvv
Автор

Worked for me, really don't f** understand what happened there ....

Daniel-cf