-
-
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
Data serialization is broken if you are using full URL to API on your hostname #8852
Comments
SvelteKit is thinking of exclusive hostname usage, but it's definitely wrong. |
Can you confirm if your issue is similar to #8851 where using the SvelteKit provided If it is similar, it should be fixed by #8869 |
@s3812497 seems like I have no similar issue because I am using |
Do you mind uploading an example project that reproduces this issue and the actual / expected behaviour? |
I will try. Also, it seems like #8851 it's about I am not sure how to fix it... basically, we can't remove the origin if it's not a part of SvelteKit routes. PS I am found a workaround - just remove the origin (protocol+hostname) if it's the browser inside |
fixes #8852 Slices the origin from any client fetch request URLs so that they're always similar in format to fetches done on the server, which is important to find cached responses --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
@s3812497 @dummdidumm thanks! |
@stalkerg thanks for filing the issue :) |
Describe the bug
My API is on the same hostname but in sub path "/api". My fetch do things like
fetch('https://my.site/api/get_user')
.The URL from this
fetch
is testing on the server side is here https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/server/page/load_data.js#L190 and removing the hostname from the URL because the origin is the same, but the client trying to search the full path by selector because we usefetch
URL as is here https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/client/client.js#L603 .It raises the second request to API, from CSR.
Reproduction
In the load function, you should make a
fetch
with the full path to the same hostname.Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: