Normalize undefined-identifier eval error message - #3828
Draft
posthog[bot] wants to merge 1 commit into
Draft
Conversation
Undefined-identifier ReferenceErrors from user circuit code splice a project-unique identifier (often a part number) and a per-engine wording into the thrown message. Both make error tracking mint a fresh issue per project.
Normalize the message to a stable prefix "Error evaluating \"...\": undefined identifier" and keep the identifier in a trailing suffix so the family groups as one issue. Cover V8/Gecko ("X is not defined") and WebKit ("Can't find variable: X") wordings.
Add tests/examples/example10-undefined-identifier.test.tsx.
Generated-By: PostHog Code
Task-Id: 71e6ec3b-2ec6-42d8-aef0-acc23e44d3e5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A_12401610E4_2A,TXB0104RGYR), the engine throws aReferenceErrorand the catch atlib/eval/import-local-file.tssplices the identifier straight into the thrown message.Can't find variable: Xwhile V8 and Gecko sayX is not defined.mechanism.handledistrue). The cost is observability noise, and it grows with every new project.Changes
tests/examples/example10-undefined-identifier.test.tsx.Agent context
fe347fa, so both old and new phrasings appear in the data today. This change targets only the undefined-identifier family.example09-not-defined-component.test.tsxasserts a "not exported by" message, which this change leaves unchanged; that test still passes.Created with PostHog Desktop from this inbox report.