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

Failed to import - `many-keys-map` | Old Pluto.jl exports

Open pankgeorg opened this issue 1 year ago • 2 comments

Failing module

  • GitHub: https://github.com/fonsp/Pluto.jl - https://github.com/fregante/many-keys-map
  • npm: https://www.npmjs.com/package/many-keys-map
import ManyKeysWeakMap from "https://cdn.esm.sh/v64/[email protected]/es2021/many-keys-weakmap.js"

Error message

After onload I got this:

GET https://esm.sh/v64/[email protected]/es2021/many-keys-weakmap.js net::ERR_ABORTED 500 (Internal Server Error)

Additional info

  • esm.sh version: 64
  • Browser version: Latest Chrome

crossref: https://github.com/fonsp/Pluto.jl/issues/3019 and https://github.com/fonsp/Pluto.jl/issues/2707 context: Pluto HTML bundles that are on the internet and refer to ESM are more-or-less immutable, as they were usually built as part of some course that has now ended, so it's not maintained.

pankgeorg avatar Sep 12 '24 11:09 pankgeorg

Hey! The problem in our project is that we version-pinned the esm.sh URL to future-proof the import. So we used

import ManyKeysWeakMap from "https://cdn.esm.sh/v64/[email protected]/es2021/many-keys-weakmap.js"

with the assumption that this would work forever, by pinning the esm.sh version, the package version and the compile target.

This import is baked into some archived html files that we generated in the past, and these files suddenly stopped working. Since this was an archival project, we can't change the import.

Is it possible to make the original import (with .js) work again, for versions where this worked in the past?

fonsp avatar Sep 17 '24 13:09 fonsp

Hi @ije, could you take a look at this?

fonsp avatar Nov 13 '24 13:11 fonsp

@pankgeorg i will fix it asap! this is broken by https://github.com/esm-dev/esm.sh/releases/tag/v112

ije avatar Nov 13 '24 14:11 ije

hi @fonsp, i just added a patch for the issue, now it works again https://esm.sh/v64/[email protected]/es2021/many-keys-weakmap.js

ije avatar Nov 13 '24 14:11 ije

Hey that's awesome, thanks so much!!

fonsp avatar Nov 13 '24 15:11 fonsp