Closed b3nten closed 1 year ago
Sometimes esm.sh is "flaky". does this import work under deno itself?
Actually I think I know why. https://github.com/lucsoft/esbuild_serve/blob/main/features/httpImports.ts#LL66C13-L69C27 It can't chose an appropriate loader because there isn't a file extension.
It will fetch depending on the content type, im pretty sure esm.sh will deliver it correctly. Personally i had also some issue with esm.sh lately
I tried using the latest version of esbuild_serve and your import works. I'm going to try later if i can reproduce it further.
You could check if it works for you currently:
import { httpImports } from "https://raw.githubusercontent.com/lucsoft/esbuild_serve/85c36a/features/httpImports.ts";
It's the latest version
Actually I think I know why. https://github.com/lucsoft/esbuild_serve/blob/main/features/httpImports.ts#LL66C13-L69C27 It can't chose an appropriate loader because there isn't a file extension.
check the content-type
header instead
It will fetch depending on the content type, im pretty sure esm.sh will deliver it correctly. Personally i had also some issue with esm.sh lately
what's your issue? i'm glad to fix 🙏
It will fetch depending on the content type, im pretty sure esm.sh will deliver it correctly. Personally i had also some issue with esm.sh lately
what's your issue? i'm glad to fix 🙏
Oh great to see you :D. Pretty sure the problem was with the npm package mjml-browser
which had the issue that the default import was missing. im not sure if its fixed already
It will fetch depending on the content type, im pretty sure esm.sh will deliver it correctly. Personally i had also some issue with esm.sh lately
what's your issue? i'm glad to fix 🙏
Oh great to see you :D. Pretty sure the problem was with the npm package
mjml-browser
which had the issue that the default import was missing. im not sure if its fixed already
probably it's a problem of the cjs-lexer! i will look into it thanks 👍🙏
Looks like the fix is appending ?target=esnext
to the url. Makes sense, as otherwise esm.sh is targetting Deno. I wonder if there is a way to set the UserAgent header to something that would automatically grab things in esnext format. I don't know if it makes sense as a default though.
headers.append("User-Agent", "es2022")
works.
im pretty sure your cache just stored an bad import. you could also do ?foo
and it should have fixed your problem
@lucsoft seems it works for me
So yeah can't really reproduce the issue.
The plugin fails to import from "https://esm.sh/solid-js/web". It works from "https://esm.sh/stable/solid-js@1.7.4/es2022/web.js"