-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
JSR import maps #23504
Comments
The problem is that import maps don't understand the semantics of the version in the URL, it must literally match the URL of the import. If you look at the module https://jsr.io/@oak/commons/0.10.1/media_types.ts you'll see that it imports: So the import map will only match that whole value, or maybe one with a trailing
I have a similar case where a package is using older versions of
|
Thanks @jollytoad {
"imports": {
"jsr:@std/[email protected]/type-by-extension": "jsr:@std/[email protected]/type-by-extension"
}
} But I think it's a very unfortunate behavior. If JSR dependencies can have different specifiers for the same file, it's really painful to work with import maps. |
What seems like a bug here is that this doesn't seem to work:
Yeah, there needs to be a better way here. |
An annoying thing (the main reason I hate And another inconsitency: it seems that the scope must be defined in http format and the imports in jsr format. // This works
{
"scopes": {
"https://jsr.io/@oak/commons/0.10.1/media_types.ts": {
"jsr:@std/[email protected]/type-by-extension": "jsr:@std/[email protected]/type-by-extension"
}
},
}
// This doesn't work
{
"scopes": {
"jsr:@oak/[email protected]/media-types": {
"jsr:@std/[email protected]/type-by-extension": "jsr:@std/[email protected]/type-by-extension"
}
},
}
// This neither
{
"scopes": {
"https://jsr.io/@oak/[email protected]/media_types.ts": {
"https://jsr.io/@std/[email protected]/type_by_extension.ts": "https://jsr.io/@std/[email protected]/type_by_extension.ts"
}
},
} |
Version: Deno 1.42.4
I have the following script:
deno info
outputs the following dependencies tree:As you can see, there are two different versions of the same package:
@std/media/0.223.0
andstd/media/0.222.1
. I want to use import maps to fix this:But it doesn't work. I've tried different strategies:
But seems that none of them fixes this issue,
deno info
outputs the same tree, ignoring the import maps.Are import maps supported in JSR dependencies?
FYI I found the same issue with NPM #23459
The text was updated successfully, but these errors were encountered: