-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: call all event handlers even if an exception occurs in one #8443
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
Conversation
@adiguba is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
fn.call(source, event); | ||
} catch (err) { | ||
// @ts-ignore | ||
if (window.reportError) { |
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.
question for more knowledgeable reviewers: will this file be called during ssr? if so, we probably need to fix this reference to window
. also note that reportError
is not yet supported in Node
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.
Oh I miss that component events can be triggered in SSR !
Don't know how to handle this correctly...
Closing as we're no longer adding stuff to Svelte 4, but updated #8403 for Svelte 5 |
Error in Svelte event dispatcher is inconsistant with the browser event handling.
I think that Svelte should mimic the browser event handling : if an error occurs on an event-handler, it should be stopped, but it should not impact the others event-handlers.
Fixes #8403
Note that I try to write an unit-test, but it fails because of the exception on the handler, and I don't know how to ignore that.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests
npm test
and lint the project withnpm run lint