-
-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(errors): add type check to error #14769
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 7b047d7 The changes in this PR will be included in the next version bump. 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 |
This comment was marked as spam.
This comment was marked as spam.
CodSpeed Performance ReportMerging #14769 will not alter performanceComparing Summary
Footnotes |
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.
Thanks @adriandlam!
|
@adriandlam can you at least tell us in which case you could encounter this issue? It isn't clear from the description. Also, we would appreciate if we could have a test that is able to reproduce the issue |
Yeah for sure @ematipico. Workflow DevKit throws an undefined unhandled rejection. In other frameworks it seems that this is just silently ignored. In Astro, unhandled rejections are caught and processed which access properties like "type" (which doesn't exist on Also yes, I'll add a test. |
Changes
vite-plugin-astro-serverwhereundefinedrejections caused TypeErrorAstroError.is(),CompilerError.is(), etc.)Cannot read property 'type' of undefinederrors whenhandleUnhandledRejectionreceives undefined rejection valuesBefore: Error type checking methods would crash when passed
nullorundefinedAfter: Error type checking methods safely return
falsefornullorundefinedvaluesTesting
No new tests added. The fix is a defensive null check that prevents TypeErrors when error type checking methods receive
nullorundefinedvalues.Docs
No docs changes needed. This is an internal bug fix that doesn't affect user-facing APIs or behavior.