-
-
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
fix: use window.fetch
for server load fetch requests
#13315
fix: use window.fetch
for server load fetch requests
#13315
Conversation
🦋 Changeset detectedLatest commit: 813f05f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
preview: https://svelte-dev-git-preview-kit-13315-svelte.vercel.app/ this is an automated message |
ad6c8ef
to
a11834e
Compare
window.fetch
for server load fetch requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
Thanks for the quick turn around! |
This PR is a follow up on #10009 which ensured that the
fetch
function from theload
event would callwindow.fetch
so that libraries (like Sentry but there are many others) can patch it. Unfortunately, I missed back then that there's another kind offetch
request made by SvelteKit: Whenever a user navigates to a route that contains a server-load function, a request is made to fetch the server-load data.This PR ensures that this server-load data request is also patchable by basically using the same mechanism introduced in #10009. I also added a test that would prior to this change fail.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits