-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
next 12: False-Positive Build Error: "Images cannot be imported within pages/_document.js" #30600
Comments
not sure if this should be tagged with |
It should definitely not be related to eslint because we have disabled next.js eslinting. |
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. |
natew
pushed a commit
to natew/next.js
that referenced
this issue
Feb 16, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
12.0.1 and 12.0.2-canary.8
What version of Node.js are you using?
14.17.6
What browser are you using?
none
What operating system are you using?
macOS
How are you deploying your application?
none
Describe the Bug
During build, this error shows up:
Note that we do not use
next/image
. We use our own webpack plugin based onfile-loader
to import images and copy them to the build output. It works fine in next.js 11 with webpack 5. We even have setimages.disableStaticImages:true
in next.config.js (even though that should not be necessary since we later might use next/image for some images except the ones in _document.tsx).Expected Behavior
It should compile fine.
To Reproduce
import favicon16 from 'static_hashed/img/touch-icons/favicon-16x16.png'
next build
ornext dev
Note that we use the imported images for
<Head><link rel="icon">
:Our webpack plugin should not be necessary to demonstrate the issue, but let us know if you need it.
The text was updated successfully, but these errors were encountered: