Open GlennBergmans opened 10 months ago
I have the same problem 🤔
Would you be able to provide a reproduction? 🙏
I think this is a minimal example: https://stackblitz.com/edit/github-im5e92-hvcadv?file=app.vue
I load the same Unsplash image 3 times:
<img>
<NuxtImg>
with unmodified path<NuxtImg>
with fixed pathWhen running in Stackblitz using npm run dev
, you'll see the image appear 3 times. However, when downloading the repo, and running using npm run generate && node node_modules/nuxt/bin/nuxt.mjs start
, you see the second case failing.
It might be OS specific: I'm running on MacOS 14.3 with case-insensitive APFS filesystem (default).
For reproduction you can run build (npm run build
) in your playground and then serve it (node .output/server/index.mjs
). Images are not generated.
I'm trying to optimize images from remote sources (e.g. unsplash) with the
ipx
provider. It works fine innpm run dev
. However when serving a static generated version, the images give 404. I suspect due to illegal filenames.Compare this:
When
url
is an unsplash image, the following output is created when runningnpm run generate
:When serving with
npm run start
, theNuxtImg
version gives a 404. The file is generated, but I suspect the filename is not valid due to the//
or one of the special characters (%
,=
,,
etc).I've found a workaround by using aliases (
alias: { 'unsplash': 'https://images.unsplash.com' }
) and stripping all query parameters, however it's not ideal:Am I doing something wrong/did I misconfigure, or did I stumble upon a bug. Is there some way to apply the workaround globally on all
<NuxtImg>
?