source-map-js icon indicating copy to clipboard operation
source-map-js copied to clipboard

Fix TS2306 “not a module” errors in type definitions

Open andersk opened this issue 2 years ago • 3 comments

Fixes TypeScript errors like this when substituting source-map-js for source-map using pnpm overrides.

node_modules/.pnpm/[email protected]_dpcjkp5o5ztxuvt4quwwvenemi/node_modules/css-minimizer-webpack-plugin/types/index.d.ts:141:28 - error TS2306: File '/srv/zulip/node_modules/.pnpm/[email protected]/node_modules/source-map-js/source-map.d.ts' is not a module.

141 type RawSourceMap = import("source-map").RawSourceMap;
                               ~~~~~~~~~~~~
  • Fixes #24.

andersk avatar Mar 06 '23 04:03 andersk

@andersk Hi! It's not clear to me: why it wasn't a problem before 1.0.2?

7rulnik avatar Mar 24 '24 12:03 7rulnik

@7rulnik This was broken by the incorrect usage of declare module that was added in #13, which was merged in 1.0.2.

See the reproduction recipe in #24.

andersk avatar Mar 24 '24 19:03 andersk

Ahhh, my bad! For some reason, I read 1.0.2 as 1.2.0 and was really confused about it. Sorry! I will take a look into it a bit later!

7rulnik avatar Mar 24 '24 19:03 7rulnik

Thanks for PR and sorry for waiting! Published as https://www.npmjs.com/package/source-map-js/v/1.2.1

7rulnik avatar Sep 08 '24 16:09 7rulnik