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

Parsing of external arg fails for scoped pkg names on &extraQuery #1074

Open
esroyo opened this issue Feb 5, 2025 · 2 comments
Open

Parsing of external arg fails for scoped pkg names on &extraQuery #1074

esroyo opened this issue Feb 5, 2025 · 2 comments
Assignees

Comments

@esroyo
Copy link

esroyo commented Feb 5, 2025

Specifying an external scoped package works fine with regular query parameters:

curl "https://esm.sh/@vue/[email protected]?external=@vue/shared"
/* esm.sh - @vue/[email protected] */
import "/@vue/[email protected]/X-ZUB2dWUvc2hhcmVk/es2022/runtime-core.mjs";
export * from "/@vue/[email protected]/X-ZUB2dWUvc2hhcmVk/es2022/runtime-dom.mjs";

However It fails when using the & query prefix to allow for importmap trailing slash:

curl "https://esm.sh/@vue/[email protected]&external=@vue/shared/"
module not found

Apparently It happens only when the external pkg is scoped (contains @?).

If not scoped, then seems to work fine:

curl "https://esm.sh/@vue/[email protected]&external=csstype/"
/* esm.sh - @vue/[email protected] */
import "/@vue/[email protected]/es2022/runtime-core.mjs";
import "/@vue/[email protected]/es2022/shared.mjs";
export * from "/@vue/[email protected]/X-ZWNzc3R5cGU/es2022/runtime-dom.mjs";

EDIT: probably the alias param has the same problem with @.

@esroyo
Copy link
Author

esroyo commented Feb 12, 2025

@ije when possible, would be great if you could take a quick look and confirm that the expectations of this test case are correct: esroyo@85ae4f0

Thanks so much!

@ije
Copy link
Member

ije commented Feb 13, 2025

I will look into it thanks 🙏

@ije ije self-assigned this Feb 13, 2025
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

2 participants