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

The "deps" query parameter is not honored fully deep

Open shawncrawley opened this issue 1 year ago • 0 comments

My development project is built on [email protected] and also requires [email protected]. However, upon using the following esm.sh endpoint in my project, I ended up with two conflicting version of react loaded in the browser (18.3.1 and 18.2.0):

https://esm.sh/[email protected][email protected]

I drilled down into the dependency tree to find the conflict. Here's the direct line trace:

https://esm.sh/[email protected][email protected] -> https://esm.sh/v135/@restart/[email protected]/es2022/Anchor.js -> https://esm.sh/v135/@restart/[email protected]/es2022/hooks.mjs -> https://esm.sh/stable/[email protected]/es2022/react.mjs

You can see that once you are 3 import chains deep, it's pulling in [email protected] instead of 18.3.1.

I ended up resolving this by pinning the version of restart/ui to the prior version: https://esm.sh/[email protected][email protected],@restart/[email protected]. Despite the workaround, I figured I'd let you know.

shawncrawley avatar Jul 22 '24 21:07 shawncrawley