You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[1.0.2 regression] TypeScript error TS2306: File '…/source-map.d.ts' is not a module #24
$ npm i source-map@npm:[email protected] typescriptadded 2 packages in 2s
$ echo'import * as SourceMap from "source-map"'> test.ts
$ npx tsc test.ts test.ts:1:28 - error TS2306: File '/tmp/node_modules/source-map/source-map.d.ts' is not a module.1 import * as SourceMap from "source-map" ~~~~~~~~~~~~Found 1 error in test.ts:1
This worked in 1.0.1 and regressed in 1.0.2. I explained the reason at #13 (review): the declare module syntax is only for stubbing third-party modules. To declare modules in the current package, you should just write a separate .d.ts file for each .js file.
Activity