-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fragment URL issue using static-adapter #3228
Comments
This is also an issue for any relative path URLs, not just #fragment URLs. E.g.,
I get an error For our use case, we have an existing website already using other frameworks. We're introducing svelte for some new static pages that will be served from the same site from a new dir. So we will be linking to existing relative URLs that Svelte doesn't produce itself or even know about. Should I open a new issue? Or did I miss a way that this use case is handled? |
Well, I just discovered |
this is broken again. I believe by #3288 |
> Using @sveltejs/adapter-static
> 404 /article/img/sample.png (linked from /article/svelte-kit-blog-demo)
at file:///mnt/6d542572-76bb-43f4-8269-4e2d72741fb7/personal/node_modules/@sveltejs/kit/dist/chunks/index5.js:427:11
at save (file:///mnt/6d542572-76bb-43f4-8269-4e2d72741fb7/personal/node_modules/@sveltejs/kit/dist/chunks/index5.js:659:4)
at visit (file:///mnt/6d542572-76bb-43f4-8269-4e2d72741fb7/personal/node_modules/@sveltejs/kit/dist/chunks/index5.js:552:3)
at processTicksAndRejections (node:internal/process/task_queues:96:5) This seem to be broken again. I'm using the latest version of sveltekit. |
@sharu725 I don't think that error is related to this issue, which was about fragment URLs. To customize SvelteKit's behavior when it encounters a broken link, you can pass a function to |
That solved my issue. Thank you @geoffrich 🙏 |
Describe the bug
When you have something like this
Route.svelte:
the page will see the URL as /test/route#something
adapter-static will check the wrong URL (/test) which doesn't exist,
Error: (404 /test (linked from /test/route))
adding an index.svelte fixes the issue, but you may not always want an index.svelte
Reproduction
https://github.com/JeremyMoeglich/href-fragment-issue
npm install
npm run build
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: