meteor/meteor

Generated .d.ts files use 'module' keyword instead of 'namespace' — breaks TypeScript 6

Open

#14.253 geöffnet am 24. März 2026

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (44.781 Stars) (5.257 Forks)batch import
TypeScriptgood first issue

Beschreibung

Description

TypeScript 6 (currently in beta) enforces TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

Meteor's generated type declaration files use declare module where declare namespace is required, causing type-checking errors with TypeScript 6+.

Affected files

In .meteor/local/types/node_modules/package-types/:

  • mongo/package/os/packages/mongo/mongo.d.ts (line 502)
  • webapp/package/os/packages/webapp/webapp.d.ts (lines 25, 72)

Steps to reproduce

  1. Create a Meteor 3.x project
  2. Install TypeScript 6 (npm install typescript@next)
  3. Run tsc --noEmit

Expected behavior

Type-checking should pass without errors.

Actual behavior

.meteor/local/types/.../mongo.d.ts(502,23): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.
.meteor/local/types/.../webapp.d.ts(25,23): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.
.meteor/local/types/.../webapp.d.ts(72,23): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

Workaround

Adding "skipLibCheck": true to tsconfig.json suppresses the errors, but this also disables type-checking for all other .d.ts files.

Suggested fix

Replace declare module with declare namespace in the type generation code for mongo and webapp packages.

Environment

  • Meteor 3.3.2
  • TypeScript 6.0.2

Contributor Guide