-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Processing the same image in multiple places causes strange errors (enhanced-img
)
#13452
Comments
My guess would be a race condition writing to and reading from the cache: https://github.com/JonasKruckenberg/imagetools/blob/fc6963f8212242797a3cc224bbd80450cc83f524/packages/vite/src/index.ts#L143 |
I manually disabled caching by setting |
I'm not convinced this is an imagetools bug, or at least it's not easily reproducible... I just set up a project with about a thousand identical images processed by |
Were they on different pages? The code changed quite a bit when we migrated to Svelte 5, so another thing to check might be whether this happens with Svelte 4 before 0.4.0: https://github.com/sveltejs/kit/blob/main/packages/enhanced-img/CHANGELOG.md#040 |
Yeah, I set up 10 pages each importing 30 copies of the same image and rendering them |
Describe the bug
When processing the same image in multiple places, there's some racey behavior causing strange and misleading errors. The likelihood of the issue occurring seems proportional to the number of instances, with 7 or so seeming to guarantee it.
Reproduction
I'm not sharing my reproduction publicly as it uses an image of me, but I have shared it internally with the maintainers.
https://github.com/elliott-with-the-longest-name-on-github/enhanced-img-repro
If you're looking to test this yourself:
enhanced-img
enhanced-img
elementsLogs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
Might downgrade severity if I can find a workaround, but haven't managed one yet.
The text was updated successfully, but these errors were encountered: