Repository navigation
Fix: Drop opaque cross-origin "Script error." events - #369
Draft
posthog-eu[bot] wants to merge 1 commit into
Draft
posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
Drop stackless "Script error." exceptions in the observability before_send hook so cross-origin script failures from extensions or third-party scripts stop reaching error tracking as high-severity, unactionable noise. Add crossorigin="anonymous" to the Cloudflare Turnstile script tag so a real Turnstile load failure reports a usable stack instead of the same opaque message. Generated-By: PostHog Desktop Task-Id: 87554b1b-8413-4f2c-8818-969ae09248db
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Contributor
🚀 Staging Environment DeployedYour staging environment is ready! URL: https://theopenpresenter-staging-pr-369-server.qzteeq.uncld.dev Note: This environment will be automatically destroyed:
To manually recreate the environment, re-run the "Build and Deploy Staging" workflow. Deployed at: 2026-09-12T03:12:35.604Z |
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
"Script error."reaches error tracking as a high-severity issue that no one can debug, so it costs triage time on an otherwise quiet project."Script error."with no stack, no source file, and a synthetic mechanism when a script from another origin throws without CORS headers. The likely source is a browser extension or an injected third-party script, not app code.before_sendhook inpackages/observability/src/initAnalytics.tsonly adds properties and never drops anything, so the event lands as an issue.crossorigin, so a genuine Turnstile load failure on the register and forgot pages would also report the same opaque message.Changes
before_sendnow returnsnullfor an$exceptionevent whose exception list is only stackless"Script error."entries.crossorigin="anonymous", so a real load failure reports a usable stack instead of an opaque message.Notes
"Script error."exceptions, so real errors that carry a stack are untouched.experimental-dtsstep fails only on the pre-existing@repo/libdeclaration resolution, present onmainand unrelated to this change.Created with PostHog Desktop from this inbox report.