[Bug] Linter Issue - @next/next/no-document-import-in-page
grez96 opened this issue · 2 comments
grez96 commented
npm run linters
generates the following error:
Error: next/document should not be imported outside of pages/_document.js. See https://nextjs.org/docs/messages/no-document-import-in-page.
Seems to happen because nextjs expects _document
file to end with a .js
extension, but in reality it ends with a .tsx
extension
DonghyukJacobJang commented
AaronLayton commented
Just dropping a note to say still an issue and replicable with "eslint-config-next": "^11.1.2",
on Windows
Temporarily adding the ignore line
{
"extends": ["next", "next/core-web-vitals"],
"rules": {
"@next/next/no-document-import-in-page": "off"
}
}