Error AtlasError Documentation and Resolution

Next.js imported next/document outside _document

No Document Import in Page

Next.js found next/document imported in a page outside pages/_document, which is unsupported and can cause unexpected application behavior.

No Document Import in Pagebuild
No Document Import in Page
  • A page component imports next/document directly.
  • Document-specific components were reused outside pages/_document.
  • A refactor moved shared layout code into a page while keeping next/document imports.
  1. Use next/document only inside pages/_document.
  2. Move shared layout markup out of next/document-specific files.
  3. Replace inappropriate document imports with normal React or Next.js components where needed.
Next.js Docs: No Document Import in Page
Next.js No Document Import in Page: causes and fixes | Error Atlas