Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import - many-keys-weakmap | Dropped support for .js vs mjs extension #703

Closed
pankgeorg opened this issue Aug 9, 2023 · 11 comments
Labels
browser Not working in Browser

Comments

@pankgeorg
Copy link

Failing module

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

Error message

After onload I got this:
404

Additional info

  • esm.sh version: 64
  • Browser version: Chrome 115 (latest)

So I think the problem is that at some point, support for the .js extension was dropped. The above link works with .mjs. This causes a few issues at the Pluto community where people have deployed versions of this without the m :(

@ije
Copy link
Member

ije commented Aug 9, 2023

the path structure has been changed, please use below urls:

import ManyKeysWeakMap from "https://esm.sh/v64/[email protected]?target=es2021"
// or
import ManyKeysWeakMap from "https://esm.sh/v64/[email protected]/es2021/many-keys-weakmap.mjs"

@pankgeorg
Copy link
Author

Thanks for your time looking into this! We will use the new in any future work, but users of old versions of Pluto have static HTML that point to the .js version on version /v64. These HTML files are deployed already and are not controlled by us - updating these will require user action. Is it possible for version 64 to respond to the .js endpoints as it used to?

@pankgeorg
Copy link
Author

We're using this style: fonsp/Pluto.jl@8d63bde and fonsp/Pluto.jl#2514 with the pin argument. Does it look ok?

@ije ije closed this as completed in 359bd8e Aug 9, 2023
@ije
Copy link
Member

ije commented Aug 9, 2023

Screenshot 2023-08-09 at 20 25 57 i am adding a workaround to redirect the old url the new url.

@ije
Copy link
Member

ije commented Aug 9, 2023

will deploy the patch after testing pass

@pankgeorg
Copy link
Author

Thank you!

@ije
Copy link
Member

ije commented Aug 10, 2023

should works now

@pankgeorg
Copy link
Author

should works now

Thanks a ton! I can see the response in cURL from a US server (my browser has a Greek/EU IP so is still getting the old value from cloudflare 😅, but I have faith in cache invalidation!!)

@ije
Copy link
Member

ije commented Aug 10, 2023

oh sorry, i am going to purge the cache

@ije
Copy link
Member

ije commented Aug 10, 2023

done, would you like to try again 🙏

@pankgeorg
Copy link
Author

yes! works like a charm, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

2 participants