Skip to content

fix: handle frontend error events without an Error object - #7544

Merged
masenf merged 2 commits into
reflex-dev:mainfrom
flcrom:fix-onerror-without-error-object
Oct 14, 2026
Merged

masenf merged 2 commits into
reflex-dev:mainfrom
flcrom:fix-onerror-without-error-object

Conversation

@flcrom

@flcrom flcrom commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7482.

window.onerror read error.name and error.message unconditionally. Some error events have no Error object, such as the benign ResizeObserver loop notification, so the handler threw and nothing reached handle_frontend_exception.

When there is no Error object, the handler now reports the message plus url:line:column instead. The existing path is unchanged when an Error is present.

Added a test to state_js.test.mjs for the no-Error case (the existing setup gained a react override so the hook can be exercised). node --experimental-vm-modules --test tests/units/compiler/state_js.test.mjs passes locally, 19/19. I did not run the full test suite or lint locally; CI will.

News fragment included.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

View guided diff

@flcrom
flcrom requested a review from a team as a code owner October 11, 2026 05:00

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous test-coverage concern fully addressed.

Summary

window.onerror now reports the message and source location when an error event has no Error object.

  • Frontend errors without an Error object still reach the backend.

Reviews (2) · Last reviewed commit: "test: assert exact payload for the no-Er..." · Reviewed by Greptile

Comment thread tests/units/compiler/state_js.test.mjs Outdated
@codspeed

codspeed Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 14 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 148 untouched benchmarks


Comparing flcrom:fix-onerror-without-error-object (b42edfd) with main (2eb1b44)

Open in CodSpeed

@masenf masenf added the on deck PRs lined up to review / merge next label Oct 13, 2026

@masenf masenf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the patch

@masenf
masenf merged commit 0d295cd into reflex-dev:main Oct 14, 2026
149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on deck PRs lined up to review / merge next

Projects

None yet

2 participants