Next.js 에러 해결: importing next/document outside of pages/_document error

리린·2021년 9월 29일
0

Next.js

목록 보기
3/17

문제점

document.tsx 파일의

import Document from "next/document";

부분이 자꾸만 에러가 났다.
정확히 말하면 에러는 아니라 lint에서 빨간줄을 긋는 거라 잘 진행되긴 한다.
하지만 영 싫단 말이지.

해결방법

  • 참조 링크

  • .eslintrc.json 파일에 다음과 같은 규칙을 추가한다.

    "rules": {
    "@next/next/no-document-import-in-page": "off"
    }

profile
개발자지망생

0개의 댓글