Skip to content

Conversation

@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Aug 21, 2024

Improves an error message and adds a codefix for type-only imports (and type imports) in CJS files that reference ESM files. The current error says that you can't do it because it will produce a require call, which isn't true for type-only imports. The real reasons are too nuanced to explain in an error message, so the new message just says what you have to do to work around it.

Related:

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 21, 2024
@andrewbranch andrewbranch merged commit a86b5e2 into microsoft:main Aug 23, 2024
@andrewbranch andrewbranch deleted the bug/type-only-esm-cjs-compat-error-message branch August 23, 2024 19:05
@sandersn sandersn removed this from PR Backlog Apr 22, 2025
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants