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

Import Maps don't support package address targets with query parameters #41

Open
NicolaiSchmid opened this issue Jul 24, 2022 · 3 comments

Comments

@NicolaiSchmid
Copy link

Reproduce:

  • Deno v1.23.3
  • import_map.json:
{
  "imports": {
      "@mui/": "https://esm.sh/@mui/[email protected]/?alias=react:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime&[email protected]"
  }
}

Deno then reports back with:

Package address targets must end with "/".

I couldn't find a current code snippet, but for version 1.9.1 I found this check, which doesn't account for esm.sh alias feature, because it just checks the last character of the value string.

If you have any further questions, please let me know

@kitsonk kitsonk transferred this issue from denoland/deno Jul 25, 2022
@kitsonk
Copy link
Contributor

kitsonk commented Jul 25, 2022

I am not sure what the spec says about handling query parameters in targets. If it is allowed, I suspect we need to change how we resolve specifiers to preserve the query paramaters.

@kitsonk kitsonk changed the title When using an import-map with esm.sh's ?alias feature, the caching fails Import Maps don't support package address targets with query parameters Jul 25, 2022
@NicolaiSchmid
Copy link
Author

It was mentioned as a solution/workaround here denoland/fresh#411 (comment) and is documented beneath the "Aliasing dependencies" headline directly on esm.sh

@ije
Copy link

ije commented Mar 6, 2023

use

{
  "imports": {
      "@mui/": "https://esm.sh/@mui/[email protected]&alias=react:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime&[email protected]/"
  }
}

instead

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

No branches or pull requests

3 participants