-
Notifications
You must be signed in to change notification settings - Fork 67
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
Broken in NextJS 11.0 #73
Comments
@Digital-Coder nice! what I find strange is that in NextJS 10 if you enable future webpack5 it works! So something between NextJS 10 and 11 with regards to webpack 5 is broken. |
Same issue. I have recently installed next@11.0.0 running on node.js v14.17.1
|
Same issue with me. |
me too |
Same for me, but I've managed to get things working by not using this I'm importing a local PNG file and passing it as |
Next.js 11 supports static image imports. |
I haven't been able to test yet but does that work with gif and svg? |
@tm1000 I've just tried with an SVG and it also works fine. There is a small limitation for SVG, but I think it's a limitation from NextJS in general. With the PNG images, I rendered a NextJS Image component and used the new |
Yesterday I played a little bit with assets module, but I had problems both with inline and resource types. It would be nice if we can pair to release next major version 🙂 |
Webpack 5 imples that CJS imports ( Digging through the PR mentioned by @thinceller it looks like that static images import in Next.js is supported only for import testJPG from '../public/test.jpg'
console.log(testJPG.src) By the way, any recommendations for automatic migraton CJS require to ES import syntax? I have found just this: https://github.com/agirton/webpack-babel-codemod |
@jnv is right. If you don't append .src to tags then it will show up as [Object%20Object] |
Same issue for me. I have problems importing svgs as markup not image with @svgr. Already tried this hint here gregberge/svgr#551 (comment) |
All Possible working solution added [Solved] Nextjs: TypeError: unsupported file type: undefined after update to v.11 |
I think this is related, but for me all my images were inlining base64 on Next.js 11.0.1. I set this option and I'm back to where I started. {
esModule: true,
+ inlineImageLimit: false
} EDIT: Well it "works" but when deployed the images are extremely small white squares... 🤔 |
I have similiar issue when changed from next 10.2.0 to next 11.0.1 |
you can set the next.config
https://nextjs.org/docs/basic-features/image-optimization#disable-static-imports |
seems like if you have a Next Image component with "placeholder=blur" set and with a import static file as source, it makes component broken with "Error: Image with src "data:image/png;b...." has "placeholder='blur'" property but is missing the "blurDataURL" property." |
not working |
I don't use next/image, so I can't say if there's side-effects |
Isn't this an all or nothing type of solution? |
Am I right that it is possible to replace
with
Seems to work for me. |
The same issue for next@11.1.2 |
The same issue for next@11.1.2
not working |
Anyway, the issue continue in 2022, lol! |
For me the problem was that I was using git LFS for my images. The Vercel Github integration seemingly doesn't support that. Rolling my own CI/CD using a Github action (which is configured to pull LFS) solves this for me. |
It works if you edit your
|
Has anyone managed to find a workaround? Setting |
This turned out to be my issue - turns out that vercel does support LFS in 2023, but you need to manually turn it on in the settings of your project. |
After upgrading to NextJS 11 the following errors are printed and the site never loads.
The text was updated successfully, but these errors were encountered: