Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.4 breaks @types/node when using isolatedModules #57136

Closed
nicolo-ribaudo opened this issue Jan 23, 2024 · 0 comments Β· Fixed by #57148
Closed

5.4 breaks @types/node when using isolatedModules #57136

nicolo-ribaudo opened this issue Jan 23, 2024 · 0 comments Β· Fixed by #57148
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@nicolo-ribaudo
Copy link

nicolo-ribaudo commented Jan 23, 2024

πŸ”Ž 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

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Jan 23, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.4.0 milestone Jan 23, 2024
@andrewbranch andrewbranch added Bug A bug in TypeScript and removed Needs Investigation This issue needs a team member to investigate its status. labels Jan 23, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants