-
Notifications
You must be signed in to change notification settings - Fork 26k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get an error saying cannot import next/document outside of _document even though it is in _document #29021
Comments
I was about to open this issue - got the same problem :) |
I got exactly same issue |
Same here |
This is likely related to #28596. Is |
Same issue, I have pages/_document.js under the alternative setup of src/pages/_document.js -- maybe this is the reason for my false positive error. |
@daliudzius What version of |
@housseindjirdeh My |
Closing as a duplicate of #28596 @daliudzius the fix is in |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.1.2
What version of Node.js are you using?
16.6.1
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
When running
next lint
I get the following output.Expected Behavior
It should not be giving the error as the import IS inside _document
To Reproduce
Create a
_document.tsx
file insrc/pages/
, have an import fornext/document
, e.gimport Document, { Head, Html, Main, NextScript } from 'next/document';
run
next lint
The text was updated successfully, but these errors were encountered: