[@types/node] cannot be type-checked with isolatedModules: true
#68285
-
|
We are getting these errors in babel/babel#16222 that are forcing us to use node_modules/@types/node/events.d.ts:878:14 - error TS1291: 'events' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'events' is imported.
878 export = events;
~~~~~~
node_modules/@types/node/module.d.ts:314:14 - error TS1291: 'module' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'module' is imported.
314 export = module;
~~~~~~
node_modules/@types/node/stream.d.ts:1700:14 - error TS1291: 'stream' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'stream' is imported.
1700 export = stream;
~~~~~~
Found 3 errors.We are using TS nightly (5.4.0-dev.20240120), but I'm still opening this discussion here because the error seems to be legit (under isolatedModules, you have to disambiguate when re-exporting imported values/types). TS5.4 will be promoted to "beta" tomorrow. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
Thanks for the discussion about "node", some useful links for everyone: Pinging the DT module owners: @microsoft, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @n-e, @galkin, @parambirs, @eps1lon, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @ZYSzys, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky. |
Beta Was this translation helpful? Give feedback.
-
|
Should we add |
Beta Was this translation helpful? Give feedback.
-
|
Fixed in TS: microsoft/TypeScript#57148 |
Beta Was this translation helpful? Give feedback.
Fixed in TS: microsoft/TypeScript#57148