meteor/meteor

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

Open

#14253 opened on Mar 24, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (44,781 stars) (5,257 forks)batch import
TypeScriptgood first issue

Description

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