Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883

Offen
#6,619 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@MFA-G arbeitet bereits daran.

Seit 08.10.2026.

  • #6620 von @MFA-G — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
74/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Start with scripts/rewrite-table-core-dts.mjs and inspect how it rewrites declaration files; reproduce the failure with the provided TypeScript consumer and package versions. Check the built dist declarations through the package exports map, since tests/declaration-emit imports from src. Done when the consumer declaration emit succeeds and the declaration test covers the built package.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

TanStack Table version

@tanstack/table-core 9.2.6 (since 9.2.5; 9.2.4 is fine)

Framework/Library version

TypeScript 6.0.3 (framework-agnostic)

Describe the bug and the steps to reproduce it

Declaration emit in a consumer fails since 9.2.5:

index.ts(3,14): error TS2883: The inferred type of 'min' cannot be named without a reference to 'RangeValue' from './node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.js'. This is likely not portable. A type annotation is necessary.

npm i @tanstack/[email protected] [email protected], then tsc -p .:

{ "compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext", "declaration": true, "emitDeclarationOnly": true, "outDir": "out" } }
import { aggregationFn_min } from '@tanstack/table-core'

export const min = aggregationFn_min

Cause: since 9.2.5 the .d.ts files no longer end with export { … } (rolldown-plugin-dts 0.28.2+ inlines the exports). A declaration file without any export statement makes TypeScript treat every top-level declaration as exported, so private aliases such as RangeValue become referable, but only through a deep path the package exports map blocks. In 9.2.6 that is 24 private declarations across 9 files.

Appending export {}; to aggregationFns.d.ts fixes the repro, and the emitted type inlines (number | Date) | undefined as with 9.2.4.

Suggested fix until the bundler fix lands (sxzz/rolldown-plugin-dts#312, PR sxzz/rolldown-plugin-dts#310): let scripts/rewrite-table-core-dts.mjs append export {}; to declaration files that have no export {…}, export * or export =. tests/declaration-emit imports from src, so a check against the built dist through the package exports would catch this.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

Inline above. The TS Playground does not reproduce it: its fetched types ignore the exports map.

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Vorherrschende Sprache
TypeScript
Sterne
28.5k
Forks
3.6k
Ø Merge
17 Std. 39 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/table

Alle Issues in TanStack/table

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.