Closed
Description
π Search Terms
isolatedModules "resolves to a type and must be marked" @types/node export import
π Version & Regression Information
- This changed between versions 5.3 and 5.4.0-dev.20240120
β― Playground Link
No response
π» Code
declare module "node:events" {
import events = require("events");
export = events;
}
from https://unpkg.com/browse/@types/node@20.11.5/events.d.ts (at the end)
π Actual behavior
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;
~~~~~~
π Expected behavior
It should work, as events
is not just a type but also a value
Additional information about the issue
DT discussion: DefinitelyTyped/DefinitelyTyped#68285
Originally found at babel/babel#16222