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

CLI esm:add seems to not respect aliases in transitive dependencies #998

Open
effulgentsia opened this issue Jan 12, 2025 · 0 comments
Open

Comments

@effulgentsia
Copy link

effulgentsia commented Jan 12, 2025

deno run -A -r https://esm.sh init
deno task esm:add react:preact/compat @radix-ui/react-slot

results in a deno.json file containing:

  "imports": {
    "@radix-ui/react-slot": "https://esm.sh/v135/*@radix-ui/[email protected]",
    "react": "https://esm.sh/v135/[email protected]/compat"
  },
  "scopes": {
    "https://esm.sh/v135/": {
      "@radix-ui/react-compose-refs": "https://esm.sh/v135/@radix-ui/[email protected]"
    }
  }

The * in the first line is nice: it means when @radix-ui/react-slot imports from react that specifier is left external and the import map is able to get that from https://esm.sh/v135/[email protected]/compat.

However, the last line does not have a *, which means when @radix-ui/react-compose-refs is imported by @radix-ui/react-slot and it imports from react, esm.sh doesn't make it external and therefore fetches React for it rather than Preact/compat.

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

1 participant