Namespace import in esm for cjs module described by any
type leads to debug failure
#51099
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
Bug Report
Namespace importing a cjs module described with an
any
type from an es module leads to a debug failure.🔎 Search Terms
Debug Failure. Unhandled type 1
🕗 Version & Regression Information
⏯ Playground Link
Can't because it's multiple files.
💻 Code
package.json
tsconfig.json
index.mts
other.cjs
other.d.cts
🙁 Actual behavior
Running
tsc
:Note: type 1 is
TypeFlags.Any
🙂 Expected behavior
Should pass type checking.
Why?
We use the file with
declare const __: any; export = __
in Deno in order to give certain modules an any type. Now when addingimpliedNodeFormat
when creating a source file in order to allow importing npm packages, I had to make this module CJS because it hasexport =
and that surfaced this issue.The text was updated successfully, but these errors were encountered: