Hello,
I was wondering if there's a way to sanitize imports for deeply nested libraries?
It's unclear how long it might take for a maintainer of a repository to merge a PR or fix the issue.
In order to resolve issue myself, I'd have to fork several repositories which causes additional issues later - after some time projects become too hard to manage.
Ideally there could be an immediate redirect to the new URL with valid version format to provide backwards-compatibility.
shell script
Warning std versions prefixed with 'v' were deprecated recently. Please change your import to https://deno.land/[email protected]/fmt/colors.ts (at https://deno.land/[email protected]/fmt/colors.ts)
error: Import 'https://deno.land/[email protected]/fmt/colors.ts' failed: 404 Not Found
Imported from "https://deno.land/x/[email protected]/deps.ts:1"
The command '/bin/sh -c deno cache deps.ts' returned a non-zero code: 1
Looking forward to hearing from you.
To urgently fix any upstream dependency problems, you can create a repair version on gist and use importmap to remap it.
such as
export add(a:number,b:number):number {
return a - b;
}
create fix version:
https://gist.githubusercontent.com/manyuanrong/39f151181a193b454c3b11dac1b60e15/raw/1d5692e4556a1e59420fbfc80dee041e22e2ab34/fix.ts
export add(a:number,b:number):number {
return a + b;
}
Create an importmap.json
{
"imports": {
"https://deno.land/x/a/mod.ts": "https://gist.githubusercontent.com/manyuanrong/39f151181a193b454c3b11dac1b60e15/raw/1d5692e4556a1e59420fbfc80dee041e22e2ab34/fix.ts"
}
}
rerun your program with:
deno run --importmap ./importmap.json mod.ts
@manyuanrong suggestion is the best way to approach this.
Also with 1.5.2, the import map can point to a local file, which was a bug that has been fixed.
@manyuanrong Thank you.
I think this issue is resolved now. (Solution is using import maps).
No what about running --reload to rebuild,, still getting the same error
As the issue states, you should be using an import map. What does your import map look like?
Most helpful comment
To urgently fix any upstream dependency problems, you can create a repair version on gist and use
importmapto remap it.such as
https://deno.land/x/a/mod.ts
create fix version:
https://gist.githubusercontent.com/manyuanrong/39f151181a193b454c3b11dac1b60e15/raw/1d5692e4556a1e59420fbfc80dee041e22e2ab34/fix.ts
Create an importmap.json
rerun your program with: