Skip to content

Investigate production Next.js/Turbopack client bootstrap errors in Sentry #161

Description

@spizeck

Problem

Two unhandled production browser errors appeared in Sentry overnight on the same Sea Saba deployment/release:

08da3607d6825def3e9c11240e0ad9c9050148dc

Both occurred on https://www.seasaba.com/ and both appear inside the Next.js/Turbopack/Sentry client bootstrap path rather than Sea Saba application code.

Event 1

InvariantError: Invariant: Expected document.currentScript to be a <script> element. Received null instead. This is a bug in Next.js.

Characteristics:

  • environment: production
  • platform: browser/javascript
  • mechanism: unhandled promise rejection
  • stack dominated by Turbopack runtime chunks
  • unsymbolicated
  • release: 08da3607...

Event 2

TypeError: WeakMap keys must be objects or non-registered symbols

Characteristics:

  • environment: production
  • platform: browser/javascript
  • mechanism: unhandled promise rejection
  • stack passes through Turbopack runtime and Sentry client integration setup
  • unsymbolicated
  • release: 08da3607...
  • Sentry privacy controls appear to be working; no unexpected customer PII observed

Goal

Determine whether these are:

  1. a Next.js/Turbopack framework bug,
  2. a Sentry + Next.js/Turbopack integration bug,
  3. a browser-specific issue,
  4. an application-triggered defect,
  5. or some combination.

Do not suppress or ignore these events until the cause is understood.

Investigation

Inspect the exact deployed commit/release and current package versions.

At minimum:

  • correlate both events to the deployment represented by release 08da3607...
  • inspect Next.js, React, Turbopack and @sentry/nextjs versions used by that release
  • identify browser/user-agent information retained by Sentry for both events if available
  • determine whether both events are Safari/WebKit-specific or cross-browser
  • search current upstream Next.js and Sentry issue trackers for the exact error signatures
  • inspect whether these errors reproduce against a local/production build
  • test repeated page loads/navigation in Chromium and WebKit
  • inspect whether Sentry initialization timing contributes to either failure
  • inspect whether instrumentation-client.ts, Next.js bootstrapping, or dynamic import/chunk registration is involved
  • determine whether the errors predate Sentry integration or began only after Add production-only Sentry error-monitoring baseline (#129) #157
  • check whether a currently supported patch/minor update of Next.js or @sentry/nextjs addresses either signature

Use authoritative upstream sources where possible.

Important boundaries

  • Do not add a Sentry ignore filter unless the error is proven harmless and unavoidable.
  • Do not disable Sentry to make the events disappear.
  • Do not make speculative production code changes.
  • Do not fold Issue Configure Sentry releases and production source maps #130 source-map/release work into this issue.
  • Do not change Dutch localization work.
  • Do not upgrade major versions casually.

If a dependency update is recommended, explain exactly which upstream issue/changelog supports it and why.

Source-map context

Issue #130 remains separate and will improve future symbolication.

Current events are unsymbolicated and show js_no_source / bundled _next/static chunks. This investigation should work with the evidence currently available, while recording anything #130 should help clarify later.

Acceptance criteria

  • Exact deployment/commit correlated.
  • Browser scope identified as far as available evidence allows.
  • Upstream Next.js/Sentry issues checked for both exact signatures.
  • Reproduction attempted in both Chromium and WebKit.
  • Determination made whether Sea Saba code is implicated.
  • Determination made whether Sentry initialization is implicated.
  • Recommended remediation is evidence-based.
  • No blanket suppression.
  • If no safe fix is available, document monitoring criteria and when to escalate.

Final report

Report:

  1. base/head/branch/PR if code changes are needed
  2. exact package versions
  3. deployment/release correlation
  4. browser/user-agent findings
  5. upstream issues found, with links
  6. reproduction results
  7. root-cause assessment
  8. whether the issue appears customer-visible
  9. whether Sentry itself contributes
  10. whether a dependency update is warranted
  11. exact remediation performed or recommended
  12. validation results
  13. whether any Sentry ignore rule was added (expected: no, unless strongly justified)
  14. what Configure Sentry releases and production source maps #130 should carry forward

If investigation finds no code change is justified, do not create a PR solely to create activity. Document the findings on the issue instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions