esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

Failed to import - types

Open jamescqcampbell opened this issue 1 year ago • 5 comments

I've patched an npm module and would like to use my fork in deno. However, I have an issue where the type declarations generated by esm.sh do not seem to have a matching path as / is omitted for type definitions.

Is there a misconfiguration on my side?

Failing module type import - wrong namespace generated

  • GitHub: https://github.com/jamescqcampbell/ts-retry
import { retryAsync } from "https://esm.sh/gh/jamescqcampbell/[email protected]"

Module is exported correctly:

/* esm.sh - gh/jamescqcampbell/[email protected] */
export * from "/v135/gh/jamescqcampbell/[email protected]/es2022/ts-retry.mjs";

i.e.

 .../v135/gh/<username>/<package>@<version>/....

But type defs are then only exported at:

.../v135/gh/<package>@<version>/... 

Which then resolves to the wrong types in deno.

Additional info

  • esm.sh version: 135

jamescqcampbell avatar Aug 13 '24 07:08 jamescqcampbell