-
-
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: prevent false positive warnings for fetch
in Firefox and Safari
#9680
Conversation
🦋 Changeset detectedLatest commit: 2dd3bd4 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 |
do you think there's some test we could add for this to the cross-browser test suite that runs in webkit? |
You're right! I think we can definitely add one. I'll try to cook up something tonight. |
There's already a test in kit/packages/kit/test/apps/basics/test/client.test.js Lines 231 to 262 in 4315e0b
Ultimately, decided against it but did use it as a reference for the false-positive specific test in test/cross-platform/client.test.js . Still feels a bit weird not co-locating it with the actual window.fetch warning test.
|
@@ -742,3 +742,24 @@ test.describe('Interactivity', () => { | |||
expect(errored).toBe(false); | |||
}); | |||
}); | |||
|
|||
test.describe('Load', () => { |
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.
I wasn't sure where to put this test, or how best to describe it. Open to suggestions.
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.
this seems like as good a place as any 👍
fixes #7992
Only Chrome-like browsers have a short stack trace, leading to a correct fetch warning. However, Safari and Firefox both have a stack trace from the beginning of the client-side initialisation, leading to false positive warnings.
The fix is to cut off the stack trace at the point where the
load
function is invoked/mentioned. This makes the stack traces for Firefox and Safari similar to Chrome.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:
.