You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the project, I have a route and a folder in static with the same name (images). Loading images/someimage.jpg working well, but accessing just images?somepaream produce an error.
Failed to load url /images?load=%2Fimages%2Fteaser.jpg (resolved id: /images?load=%2Fimages%2Fteaser.jpg). This file is in /public and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.
Seems relating to #5672 but in a more special way.
After build there is no problem, only in dev mode I get this error.
9:05:21 PM [vite] Internal server error: Failed to load url /images?load=%2Fimages%2Fteaser.jpg (resolved id: /images?load=%2Fimages%2Fteaser.jpg). This file is in /public and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.
at loadAndTransform (file:///home/wolle/Workspace/vally/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:39798:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5) (x2)
I tried to rebuild it with vite vanilla, but I never did a project with vite beside svelte kit so I am not sure if I test it correctly, but I didn't get an error.
I created a project with npm create vite-extra@latest -- --template ssr-svelte
Afterwards I added a route in server.js for GET requests on /images and I created a folder images in public. It toke the server route and didn't throw an error. So for me it looks like everything is ok in vite.
I'm pretty sure this is a Vite issue - our code correctly determines that this is not a static asset since it's a directory, then calls the next middleware which happens to be Vite's which then throws the error.
Describe the bug
In the project, I have a route and a folder in static with the same name (images). Loading
images/someimage.jpg
working well, but accessing justimages?somepaream
produce an error.Failed to load url /images?load=%2Fimages%2Fteaser.jpg (resolved id: /images?load=%2Fimages%2Fteaser.jpg). This file is in /public and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.
Seems relating to #5672 but in a more special way.
After build there is no problem, only in dev mode I get this error.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-yefxpo?file=src/routes/index.svelte
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: