Error: <Html> should not be imported outside of pages/_document

49 views Asked by At

I use next 14.1.0 app directory and create files as example layout for Root. When npm run build in local everything is okay but on the server I got some errors as example

Error: should not be imported outside of pages/_document. TypeError: Cannot read properties of null (reading 'useContext')

I do not use pages in app direcotry. I use a layout file in app directory. How can I fix it?

I want to know reason for this error

0

There are 0 answers