TypeScript errors in PolarisErrorBoundary #39

Closed
opened 2026-03-13 20:34:13 +00:00 by ghost · 2 comments
ghost commented 2026-03-13 20:34:13 +00:00 (Migrated from github.com)

Description:
TypeScript compilation fails with errors in src/index.tsx related to the PolarisErrorBoundary class component.

Errors:

src/index.tsx(41,17): error TS2339: Property 'props' does not exist on type 'PolarisErrorBoundary'.
src/index.tsx(79,6): error TS2786: 'PolarisErrorBoundary' cannot be used as a JSX component.

Steps to reproduce:

  1. Clone the repo
  2. Run npm install
  3. Run npm run tsc

Expected: TypeScript should compile without errors
Actual: 5 TypeScript errors related to React.Component typing

Tests: 77 unit tests pass

Additional context:

  • React version: 18.3.1
  • Issue appears to be a React 18 + TypeScript type compatibility issue with class components
  • The error boundary works at runtime (tests pass), but TypeScript types are misaligned
**Description:** TypeScript compilation fails with errors in `src/index.tsx` related to the `PolarisErrorBoundary` class component. **Errors:** ``` src/index.tsx(41,17): error TS2339: Property 'props' does not exist on type 'PolarisErrorBoundary'. src/index.tsx(79,6): error TS2786: 'PolarisErrorBoundary' cannot be used as a JSX component. ``` **Steps to reproduce:** 1. Clone the repo 2. Run `npm install` 3. Run `npm run tsc` **Expected:** TypeScript should compile without errors **Actual:** 5 TypeScript errors related to React.Component typing **Tests:** 77 unit tests pass **Additional context:** - React version: 18.3.1 - Issue appears to be a React 18 + TypeScript type compatibility issue with class components - The error boundary works at runtime (tests pass), but TypeScript types are misaligned
ghost commented 2026-03-13 22:33:18 +00:00 (Migrated from github.com)

Cannot Reproduce — TypeScript Compiles Clean

I investigated this issue thoroughly:

  • npm run tsc (tsc --noEmit) passes with zero errors (TypeScript 5.6.2)
  • All 77 unit tests pass
  • PolarisErrorBoundary already has correct generic params: extends React.Component<{ children: React.ReactNode }, ErrorBoundaryState>

The reported errors (TS2339: Property 'props' does not exist, TS2786: cannot be used as a JSX component) would occur if the class lacked explicit generic type parameters, but the current code already has them.

This may have been resolved by PR #37 (which removed stale type references from tsconfig.json) or was environment-specific. Closing as fixed.

Verification steps:

npm ci --include=dev
npm run tsc     # clean
npm run test    # 77/77 pass
## Cannot Reproduce — TypeScript Compiles Clean I investigated this issue thoroughly: - `npm run tsc` (`tsc --noEmit`) passes with zero errors (TypeScript 5.6.2) - All 77 unit tests pass - `PolarisErrorBoundary` already has correct generic params: `extends React.Component<{ children: React.ReactNode }, ErrorBoundaryState>` The reported errors (`TS2339: Property 'props' does not exist`, `TS2786: cannot be used as a JSX component`) would occur if the class lacked explicit generic type parameters, but the current code already has them. This may have been resolved by PR #37 (which removed stale type references from `tsconfig.json`) or was environment-specific. Closing as fixed. **Verification steps:** ``` npm ci --include=dev npm run tsc # clean npm run test # 77/77 pass ```
ghost commented 2026-03-13 22:33:24 +00:00 (Migrated from github.com)

Closing — cannot reproduce. TypeScript compiles clean on current main.

Closing — cannot reproduce. TypeScript compiles clean on current main.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: privilegedescalation/headlamp-polaris-plugin#39