【发布时间】:2021-11-02 18:12:12
【问题描述】:
由于 Next.js 自定义文档,我在构建期间收到此错误。
因此,在构建期间,我收到一条错误消息,说我在 pages/_document.js 中也有 _document.js。
next/document should not be imported outside of pages/_document.js. See https://nextjs.org/docs/messages/no-document-import-in-page.
请帮帮我!
编辑
将 next 和 eslint-config-next 更新到版本 11.1.3-canary.7
【问题讨论】:
-
如果您看到
next/document躺在其他地方,请四处搜索? -
不,没有
-
这是一个已知问题,请尝试更新为我的答案,看看是否有帮助。
标签: node.js compiler-errors next.js