Deno: Deprecated imports inaccessible during build-time

Created on 10 Nov 2020  路  6Comments  路  Source: denoland/deno

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.

cli suggestion

Most helpful comment

To urgently fix any upstream dependency problems, you can create a repair version on gist and use importmap to remap it.

such as

https://deno.land/x/a/mod.ts

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

All 6 comments

To urgently fix any upstream dependency problems, you can create a repair version on gist and use importmap to remap it.

such as

https://deno.land/x/a/mod.ts

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kitsonk picture kitsonk  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

ry picture ry  路  3Comments

sh7dm picture sh7dm  路  3Comments

motss picture motss  路  3Comments