-
Notifications
You must be signed in to change notification settings - Fork 270
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
NuxtImage + IPX + SWR = return buffer #1400
Comments
do you have reproduction? I can't seem to replicate the issue |
Sure: git clone https://github.com/bernhardberger/nuxt-ipx-swr-buffer-minimal-reproduction
cd nuxt-ipx-swr-buffer-minimal-reproduction
npm run build && node .output/server/index.mjs -> hard reload (CTRL+SHIFT+R) a few times after 10 seconds -> image will be dead |
related: nuxt/nuxt#27307 |
Imho this should be documented.. |
We have now solved this using a nitro onBeforeResponse hook that unwraps and streams the Buffer so we can still use swr caching on /_ipx/** generated images (so the image gets served from a cache and the user won't have to wait for the regenerated image every time) We'll provide a code sample later when it's tested. |
Hey @bernhardberger, did you already done working with nitro hook code sample? Thanks in advance. |
+1 |
When I enable SWR on our website IPX/nitro/whatever the culprit.. returns a buffer instead of an image:
Any ideas how to work around this? This has been a major issue for us, preventing is to run SWR on our website and customer projects..
The text was updated successfully, but these errors were encountered: