Skip to content

fix(error-boundary): Prevent TypeError when rendering fallback UI - #4134

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/error-boundary-type-error
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/error-boundary-type-error

Conversation

@sentry

@sentry sentry Bot commented Sep 25, 2026

Copy link
Copy Markdown

Description

This PR addresses a TypeError: Cannot read properties of undefined (reading 'match') that occurs when the ErrorBoundary's fallback UI (DefaultUI) attempts to render.

The root cause is that the ErrorBoundary is mounted outside the React Router context in src/index.tsx. The DefaultUI in src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx was using the router-dependent <A> component, which internally calls useNavLinks() and useParams(). When useParams() is called outside a Router, useContext(RouterContext) returns undefined, leading to the TypeError when .match is accessed.

The fix involves replacing the <A to={{ pageName: 'support' }}> component in DefaultUI with a standard HTML <a href="https://codecovpro.zendesk.com/hc/en-us" target="_blank" rel="noreferrer"> tag. This removes the dependency on the React Router for the error boundary's support link, ensuring the fallback UI can render correctly even when an error occurs outside the router's scope.

Code Example

N/A

Notable Changes

  • Replaced router-dependent <A> component with a standard HTML <a> tag in ErrorBoundary's DefaultUI.
  • Resolved TypeError: Cannot read properties of undefined (reading 'match') when ErrorBoundary renders outside React Router context.
  • Ensures ErrorBoundary's fallback UI can render correctly regardless of router context.

Screenshots

N/A

Link to Sample Entry

N/A

Legal Boilerplate

Look, I get it. The entity doing business as "Codecov" is owned by Harness, Inc. In 2026 Harness acquired Codecov and as a result Harness is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Harness can use, modify, copy, and redistribute my contributions, under Harness's choice of terms.

Fixes GAZEBO-15Y6

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry

sentry Bot commented Sep 25, 2026

Copy link
Copy Markdown
Author

⚠️ Sentry needs additional GitHub App permissions

The Sentry GitHub App installation for this repository is missing permissions it needs to keep iterating on this pull request to get CI passing.

Review and accept the updated permissions to let Seer continue: https://github.com/organizations/codecov/settings/installations/86101127/permissions/update

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 184 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 5.82MB 94 bytes (0.0%) ⬆️
gazebo-production-esm 5.89MB 90 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 94 bytes 657.91kB 0.01%

Files in assets/index-legacy.*.js:

  • ./src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx → Total Size: 1.41kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 90 bytes 577.9kB 0.02%

Files in assets/index.*.js:

  • ./src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx → Total Size: 1.41kB

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #4134   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         823      823           
  Lines       15147    15147           
  Branches     4387     4379    -8     
=======================================
  Hits        14961    14961           
  Misses        179      179           
  Partials        7        7           
Files with missing lines Coverage Δ
src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f454999. Read the comment docs.

@codecov-public-qa

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.77%. Comparing base (b8fbfc0) to head (f454999).

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #4134   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         823      823           
  Lines       15147    15147           
  Branches     4379     4387    +8     
=======================================
  Hits        14961    14961           
  Misses        179      179           
  Partials        7        7           
Files with missing lines Coverage Δ
src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f454999. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.77%. Comparing base (b8fbfc0) to head (f454999).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4134   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         823      823           
  Lines       15147    15147           
  Branches     4387     4387           
=======================================
  Hits        14961    14961           
  Misses        179      179           
  Partials        7        7           
Files with missing lines Coverage Δ
src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f454999. Read the comment docs.

@codecov-releaser

Copy link
Copy Markdown
Collaborator

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
f454999 Fri, 25 Sep 2026 10:49:46 GMT Cloud Enterprise

@codecov-qa

codecov-qa Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.77%. Comparing base (b8fbfc0) to head (f454999).

@@           Coverage Diff           @@
##             main    #4134   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         823      823           
  Lines       15147    15147           
  Branches     4387     4387           
=======================================
  Hits        14961    14961           
  Misses        179      179           
  Partials        7        7           
Files with missing lines Coverage Δ
src/layouts/shared/ErrorBoundary/ErrorBoundary.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.43% <ø> (ø)
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f454999. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant