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
Relative asset paths broke usage of imagetools #6326
Comments
Maybe it's related: #6769 |
Do you know any workaround? |
this is a major issue since no image is working on urls deeper than base, if we dont hardhack the baseurl. |
Hey there, as a workaround you can do: <script>
import image from './image.png?webp';
</script>
<img src="/{image}" alt="image" /> |
i got away with something like that as i serve my images locally from an images folder within the static folder
thanks for the help tho |
It seems to be an issue with imagetools after all. Can you pls check if your use case works with JonasKruckenberg/imagetools#400? |
I talked to @pzerelles, the author of JonasKruckenberg/imagetools#400, and he clarified that the issue is that Vite assets treats everything relative to Vite's basepath and not relative from where the asset is included, so Vite imagetools will need to use absolute paths rather than relative paths. Given that the issue is in imagetools and not Vite, I will go ahead and close this issue |
Describe the bug
The relative asset paths for the static adapter do not work when I use vite imagetools.
The resulting paths are always starting with
./_app/...
instead of/_app/...
. So the images are only working on the root path and don't load on any subpage.I'm not sure whether this has to be adopted in image tools or if there should be an option in svelte kit to disable that behavior. Maybe both. In general, I think relative paths are great and would love to have this feature work with imagetools.
Breaking PR in Svelte Kit: #4250
Coresponding Issue in imagetools: JonasKruckenberg/imagetools#367
Reproduction
Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: