-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed as not planned
Labels
invalidwhat appeared to be an issue with Deno wasn'twhat appeared to be an issue with Deno wasn'tnode compat
Description
Describe the bug
npm:* default exports are incorrectly typed. Packages that are exported as default are assumed to have a default property. The plugin will claim a type error when there are no actual runtime errors. Furthermore, trying to appease the plugin error by using the default property will actually result in runtime errors.
To Reproduce
- Create a file
script.ts
import clsx from 'npm:clsx';
console.log(clsx("hello", "goodbye"));- Cache dependencies, notice the following error:
This expression is not callable.
Type 'typeof import("file:///Users/pting/Library/Caches/deno/npm/registry.npmjs.org/clsx/1.2.1/clsx")' has no call signatures.deno-ts(2349)
-
Try running
deno run script.ts, notice there are no errors at runtime -
Try appeasing the compiler:
console.log(clsx.default("hello", "goodbye"));- Notice runtime error.
Expected behavior
Expected plugin parsing behavior to match runtime behavior.
Screenshots
Versions
vscode: 1.77.3 deno: 1.33.0 extension: 3.17.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
invalidwhat appeared to be an issue with Deno wasn'twhat appeared to be an issue with Deno wasn'tnode compat
