Skip to content

Fix TS2742 typecheck failure in deck3DConfigStore#1080

Merged
cugarteblair merged 1 commit into
mainfrom
issue-1079-fix-deck3d-typecheck
Jun 9, 2026
Merged

Fix TS2742 typecheck failure in deck3DConfigStore#1080
cugarteblair merged 1 commit into
mainfrom
issue-1079-fix-deck3d-typecheck

Conversation

@cugarteblair

Copy link
Copy Markdown
Member

Summary

Closes #1079.

make typecheck (vue-tsc --noEmit -p tsconfig.app.json) has been failing on main:

src/stores/deck3DConfigStore.ts(6,14): error TS2742: The inferred type of
'useDeck3DConfigStore' cannot be named without a reference to
'../../node_modules/@deck.gl/core/dist/transitions/transition'. This is likely
not portable. A type annotation is necessary.

Root cause

viewState was declared as reactive<OrbitViewState>(...) and returned from the Pinia setup store. reactive() unwraps its generic structurally (UnwrapNestedRefs<OrbitViewState>), and that expansion pulls in @deck.gl/core's internal, non-exported transitions/transition type. TypeScript then can't name the store's inferred public type portably → TS2742 (reported at the defineStore call on L6).

make build was unaffected (it runs vite build / esbuild only, no vue-tsc), so this never blocked deploys — but it kept the typecheck gate red and masked real regressions.

Change (web-client/src/stores/deck3DConfigStore.ts)

  • Added a local, portable Deck3DViewState interface covering the fields actually used (target, zoom, rotationX, rotationOrbit) and typed the reactive viewState with it instead of OrbitViewState.
  • Kept OrbitViewState as the updateViewState(vs) parameter type — there it's referenced by its public name, not structurally expanded, so the deck.gl onViewStateChange callback in deck3DPlotUtils.ts still passes through unchanged.

Purely type-level; no runtime behavior change (the reactive() generic is erased at runtime and the object initializer is identical).

Verification

  • make typecheck → exits 0; the whole project (including the deck.gl consumers deck3DPlotUtils.ts and SrDeck3DCfg.vue) typechecks.
  • eslint + prettier clean.

🤖 Generated with Claude Code

reactive<OrbitViewState>() structurally unwraps the deck.gl type, dragging
in @deck.gl/core's internal (non-exported) transitions/transition type and
tripping TS2742 on the store's inferred public type, which made
`make typecheck` red on main.

Type the reactive viewState with a local, portable Deck3DViewState interface
covering the fields actually used (target, zoom, rotationX, rotationOrbit).
OrbitViewState is retained as the updateViewState() parameter type — it is
referenced by its public name there, not structurally expanded, so the
deck.gl onViewStateChange callback still passes through unchanged. No runtime
behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cugarteblair
cugarteblair merged commit 0f5784a into main Jun 9, 2026
1 check passed
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.

make typecheck fails on deck3DConfigStore.ts (TS2742 non-portable inferred type)

1 participant