Closed gavinsharp closed 4 years ago
It is obviously annoying to try to chase compatibility with custom configs, so I feel like the only option for this is WONTFIX (which I would be fine with, we plan to stop using next-css as soon as we can), or reverting that change in 1.4.0 (not sure if it is just an optimization or if it was fixing a bug).
@gavinsharp Feel you, bro. I wasted my whole day because of this.
For me, this error also occurs when using Next.js's built-in CSS support (no next-css package is installed). I am doing a simple <img src={require("path/to/image.png")}/>
in a component. The errors do not happen on the previous version, 1.3.1.
Swapping out next-images for next-optimized-images (tested with 2.6.0) fixed the issue. It seems to do everything that next-images does, in addition to reducing image size.
@gavinsharp I'm super sorry for the late response. Thanks for reporting and helping to fix it. WIill check it right now.
Version 1.3.1 works fine, 1 4.1 does not
Our Next app still uses
next-css
(despite built-in CSS support as of 9.2) because of some legacy requirements and subtle differences in how the two behave (next-css
allows imports of CSS outside of_app.js
).Upgrading to 1.4.0 of
next-images
broke our app:slick-theme.css
has image imports.This change https://github.com/twopluszero/next-images/commit/211f6649d3af3257a83c5d16ccf4b46e096ae87c#diff-168726dbe96b3ce427e7fedce31bb0bc appears to assume Next's built-in CSS support is always present, but that isn't necessarily the case (depending on Next config). Backwards compatibility with custom configs is explicitly mentioned in the 9.2 post: