deno: Argument of type 'string | URL' is not assignable to parameter of type 'string'
Just upgrade my deno to 1.2 and then my production software failure, i really need some help in hurry , anybody can help?
error: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/std@v0.55.0/path/win32.ts:917:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/std@v0.55.0/path/posix.ts:438:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/std@0.51.0/path/win32.ts:911:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/std@0.51.0/path/posix.ts:433:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/std@0.55.0/path/win32.ts:917:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/std@0.55.0/path/posix.ts:438:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/std@0.59.0/path/win32.ts:917:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/std@0.59.0/path/posix.ts:438:18
Found 8 errors.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 37 (14 by maintainers)
@chovy It looks like there’s an unversioned dependency on the std/log module, which is causing that error. You can try reloading the cache by running
deno cache --reload deps.ts, and try again, that should hopefully fix the error.Caused by #6653. Version of
stdprior to 0.61.0 are incompatible with Deno 1.2.0.deno info main.tswill give you the dependency graph and you can determine what dependencies need to be updated to they are usingstd0.61.0.I’m so lost. how the f— do I fix this error? There’s no package manager.
I am getting this error too. But, it seems to be deep within deno
But, hey, I could be missing the boat entirely.
PS: Here is my code:
https://github.com/reselbob/denodemoHere is how to replicate:
Thanks in advance. I really am at wit’s end. If the trouble is my own doing, please forgive me.
I had this problem after updating in a script which uses only Deno dependencies. I had to refresh the cache by running the
deno cachecommand above. I figured it was a catching issue but wasn’t sure how to resolve it. Thanks @fauzan121002