esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.05k stars 146 forks source link

Failed to import - types #862

Open jamescqcampbell opened 1 month ago

jamescqcampbell commented 1 month ago

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

import { retryAsync } from "https://esm.sh/gh/jamescqcampbell/ts-retry@v4.2.6"

Module is exported correctly:

/* esm.sh - gh/jamescqcampbell/ts-retry@v4.2.6 */
export * from "/v135/gh/jamescqcampbell/ts-retry@v4.2.6/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

ije commented 1 month ago
Screenshot 2024-08-13 at 15 52 17

i think it's a resoving bug of esm.sh, i will look into it

ije commented 1 month ago

seems v136 works correctly, but it has not not been deployed yet

Screenshot 2024-08-13 at 15 59 45
jamescqcampbell commented 1 month ago

@ije thanks so much for the quick response. I know that you're still working on v136 - do you know of a good workaround to use before that comes out?

ije commented 1 month ago

i will add a fixpatch for v135 tmr

jamescqcampbell commented 1 month ago

Thank you so much!