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

Argument of type 'string | URL' is not assignable to parameter of type 'string' #6755

Closed
gungunfebrianza opened this issue Jul 15, 2020 · 37 comments

Comments

@gungunfebrianza
Copy link

gungunfebrianza commented Jul 15, 2020

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.
@kitsonk
Copy link
Contributor

kitsonk commented Jul 15, 2020

Caused by #6653. Version of std prior to 0.61.0 are incompatible with Deno 1.2.0. deno info main.ts will give you the dependency graph and you can determine what dependencies need to be updated to they are using std 0.61.0.

@gungunfebrianza
Copy link
Author

hi @kitsonk thank you so much for coming and helping us, i will try :)

@gungunfebrianza
Copy link
Author

hi @kitsonk this is the result of deno info index.ts on my system :

`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

TS2339 [ERROR]: Property 'link' does not exist on type 'typeof Deno'. 'Deno.link' is an unstable API. Did you forget to run with the '--unstable' flag?
await Deno.link(src, dest);
~~~~
at https://deno.land/std@0.55.0/fs/ensure_link.ts:28:14

TS2339 [ERROR]: Property 'linkSync' does not exist on type 'typeof Deno'. 'Deno.linkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.linkSync(src, dest);
~~~~~~~~
at https://deno.land/std@0.55.0/fs/ensure_link.ts:52:8

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(src, dest, {
~~~~~~~
at https://deno.land/std@0.55.0/fs/ensure_symlink.ts:33:16

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(src, dest);
~~~~~~~
at https://deno.land/std@0.55.0/fs/ensure_symlink.ts:37:16

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(src, dest, {
~~~~~~~~~~~
at https://deno.land/std@0.55.0/fs/ensure_symlink.ts:65:10

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(src, dest);
~~~~~~~~~~~
at https://deno.land/std@0.55.0/fs/ensure_symlink.ts:69:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, statInfo.atime, statInfo.mtime);
~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:92:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
~~~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:103:10

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(originSrcFilePath, dest, {
~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:117:16

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(originSrcFilePath, dest);
~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:121:16

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, statInfo.atime, statInfo.mtime);
~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:127:16

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(originSrcFilePath, dest, {
~~~~~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:141:10

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(originSrcFilePath, dest);
~~~~~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:145:10

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
~~~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:152:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:172:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
~~~~~~~~~
at https://deno.land/std@0.55.0/fs/copy.ts:200:10

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

TS2339 [ERROR]: Property 'link' does not exist on type 'typeof Deno'. 'Deno.link' is an unstable API. Did you forget to run with the '--unstable' flag?
await Deno.link(src, dest);
~~~~
at https://deno.land/std/fs/ensure_link.ts:28:14

TS2339 [ERROR]: Property 'linkSync' does not exist on type 'typeof Deno'. 'Deno.linkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.linkSync(src, dest);
~~~~~~~~
at https://deno.land/std/fs/ensure_link.ts:52:8

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(src, dest, {
~~~~~~~
at https://deno.land/std/fs/ensure_symlink.ts:32:16

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(src, dest);
~~~~~~~
at https://deno.land/std/fs/ensure_symlink.ts:36:16

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(src, dest, {
~~~~~~~~~~~
at https://deno.land/std/fs/ensure_symlink.ts:64:10

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(src, dest);
~~~~~~~~~~~
at https://deno.land/std/fs/ensure_symlink.ts:68:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, statInfo.atime, statInfo.mtime);
~~~~~
at https://deno.land/std/fs/copy.ts:92:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
~~~~~~~~~
at https://deno.land/std/fs/copy.ts:103:10

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(originSrcFilePath, dest, {
~~~~~~~
at https://deno.land/std/fs/copy.ts:117:16

TS2339 [ERROR]: Property 'symlink' does not exist on type 'typeof Deno'. 'Deno.symlink' is an unstable API. Did you forget to run with
the '--unstable' flag?
await Deno.symlink(originSrcFilePath, dest);
~~~~~~~
at https://deno.land/std/fs/copy.ts:121:16

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, statInfo.atime, statInfo.mtime);
~~~~~
at https://deno.land/std/fs/copy.ts:127:16

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(originSrcFilePath, dest, {
~~~~~~~~~~~
at https://deno.land/std/fs/copy.ts:141:10

TS2339 [ERROR]: Property 'symlinkSync' does not exist on type 'typeof Deno'. 'Deno.symlinkSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.symlinkSync(originSrcFilePath, dest);
~~~~~~~~~~~
at https://deno.land/std/fs/copy.ts:145:10

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
~~~~~~~~~
at https://deno.land/std/fs/copy.ts:152:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the
'--unstable' flag?
await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
~~~~~
at https://deno.land/std/fs/copy.ts:172:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
~~~~~~~~~
at https://deno.land/std/fs/copy.ts:200:10

Found 40 errors.`

@gungunfebrianza
Copy link
Author

Caused by #6653. Version of std prior to 0.61.0 are incompatible with Deno 1.2.0. deno info main.ts will give you the dependency graph and you can determine what dependencies need to be updated to they are using std 0.61.0.

how to update my std into specific version on my system??

@kitsonk
Copy link
Contributor

kitsonk commented Jul 15, 2020

Sorry, I forgot it tries to do a compile.

The problem is still the same, code you are using is depending on std prior to 0.61.0 and you need to update those dependencies (or get those dependencies updated). You could go back to 1.1.3 to do the deno info if you really need to see the dependency graph.

@kitsonk
Copy link
Contributor

kitsonk commented Jul 15, 2020

https://deno.land/std@v0.61.0/... if you are importing it, but it looks like you are depending on code that is importing it itself, so you need to update those dependencies.

@gungunfebrianza
Copy link
Author

gungunfebrianza commented Jul 15, 2020

Sorry, I forgot it tries to do a compile.

The problem is still the same, code you are using is depending on std prior to 0.61.0 and you need to update those dependencies (or get those dependencies updated). You could go back to 1.1.3 to do the deno info if you really need to see the dependency graph.

hi @kitsonk we are going back to deno 1.1.3 and then we get new error but only one error :

error: TS2345 [ERROR]: Argument of type '{ depth: number; sorted: boolean; trailingComma: boolean; compact: boolean; iterableLimit: number; }' is not assignable to parameter of type 'InspectOptions'.
Object literal may only specify known properties, and 'sorted' does not exist in type 'InspectOptions'.
sorted: true,
~~~~~~~~~~~~
at https://deno.land/std@0.61.0/testing/asserts.ts:26:9

@kitsonk
Copy link
Contributor

kitsonk commented Jul 15, 2020

So something you are using is only compatible with Deno 1.2.0 and is importing std 0.61.0 and something you are using is not compatible with Deno 1.2.0 and is using std prior to 0.61.0 (several things by the look of the original errors).

@gungunfebrianza
Copy link
Author

An alternative solution i need to remove some package and create alternative API using node.js, here some package that become culprit :

// export { multiParser, FormFile } from "https://deno.land/x/multiparser/mod.ts";
// export { readFileStr, readFileStrSync } from "https://deno.land/std/fs/mod.ts";
// export {
// upload,
// preUploadValidate,
// } from "https://deno.land/x/upload_middleware_for_oak_framework/mod.ts";

hi @kitsonk thank you so much for your help

@reselbob
Copy link

reselbob commented Jul 21, 2020

I am getting this error too. But, it seems to be deep within deno

Check file:///Users/reselbob/Documents/source-tree/denodemo/pubbersubber/tests/.deno.test.ts
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.57.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.57.0/path/posix.ts:438:18
$ deno --version
deno 1.2.0
v8 8.5.216
typescript 3.9.2

But, hey, I could be missing the boat entirely.

PS: Here is my code: https://github.com/reselbob/denodemo

Here is how to replicate:

git clone https://github.com/reselbob/denodemo.git
cd denodemo/pubbersubber/tests/
sh run_tests.sh

Thanks in advance. I really am at wit's end. If the trouble is my own doing, please forgive me.

@kitsonk
Copy link
Contributor

kitsonk commented Jul 22, 2020

@reselbob your problem is the same as the others. You are using Deno 1.2.0, but some dependency of yours is pulling in std prior to 0.61.0 (the log states it is 0.57.0). You need to identify the offending dependency and update it.

@reselbob
Copy link

reselbob commented Jul 22, 2020

Thank you @kitsonk, sincerely.

So are you saying that one of the culprits, https://deno.land/std@v0.57.0/path/posix.ts:438:18 is not being called within the standard library, but by a third-party module that is calling, the offender, https://deno.land/std@v0.57.0/path/posix.ts:438:18?

I wish there was a way I could see the full stack trace.

Again, thank you!

@Yamboy1
Copy link

Yamboy1 commented Jul 22, 2020

@reselbob deno info --no-check deps.ts should show you a tree listing of all your dependencies.

@reselbob
Copy link

reselbob commented Jul 22, 2020

reselbob@bobs-mbp deps % pwd
/Users/reselbob/Library/Caches/deno/deps
reselbob@bobs-mbp deps % deno info --no-check deps.ts
error: Cannot resolve module "file:///Users/reselbob/Library/Caches/deno/deps/deps.ts"

Am I doing something terribly wrong @Yamboy1

@kitsonk
Copy link
Contributor

kitsonk commented Jul 22, 2020

You should replace deps.ts with a file that you have on your local machine. Likely what you run with deno run ....

@ralyodio
Copy link

I'm so lost. how the f--- do I fix this error? There's no package manager.

@Yamboy1
Copy link

Yamboy1 commented Jul 24, 2020

@chovy Deno has a package manager built into it. if you run deno info --no-check deps.ts (replace deps.ts with whatever your main entry file is if you don't have a deps.ts), it should give you a tree view of all your dependencies. From there you can work out which dependencies are the problem, and deal with it accordingly

@ralyodio
Copy link

ralyodio commented Jul 24, 2020 via email

@reselbob
Copy link

@chovy, elaborate, please. Does your comment reference something in my code?

@Yamboy1
Copy link

Yamboy1 commented Jul 24, 2020

@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.

@kitsonk
Copy link
Contributor

kitsonk commented Jul 24, 2020

@chovy that additional error you have is that the code is not --no-check safe. ./levels.ts is re-exporting a type that does not have a runtime emit. So instead of export { SomeInterface } from "whatever.ts" you should use export type { SomeInterface } from "whatever.ts".

@mwoodpatrick
Copy link

I'm still having problems resolving this problem when I run:

deno info --no-check bin/server.ts

I get:

error: Uncaught SyntaxError: The requested module 'https://deno.land/std@v0.51.0/async/mod.ts' does not provide an export named 'Deferred'

This is trying to build and run:

https://github.com/fhsinchy/deno-blog

I;m unclear how to get a current list of dependencies when what I'm currently dependent on has this issue is this all documented somewhere. Is there a deno discussion group that I can discuss this issue on?

@Soremwar
Copy link
Contributor

@mwoodpatrick Join us on discord

https://discord.gg/deno

@mwoodpatrick
Copy link

Will do, many thanks

@fzn0x
Copy link
Contributor

fzn0x commented Jul 30, 2020

deno cache --unstable --reload deps.ts really solve my issue , you need to include --unstable to make sure the unstable API not throwing errors and reload it.

@thecrypticace
Copy link

I had this problem after updating in a script which uses only Deno dependencies. I had to refresh the cache by running the deno cache command above. I figured it was a catching issue but wasn't sure how to resolve it. Thanks @fauzan121002

@GuilhermeVendramini
Copy link

GuilhermeVendramini commented Jul 30, 2020

Workaround:
First: If you are using denon upgrade your denon to the last version.
In my case I'm using import map to manager my packages (--importmap=package.json), so I added the following lines:

    "https://deno.land/std@v0.51.0/path/win32.ts": "https://deno.land/std@v0.62.0/path/win32.ts",
    "https://deno.land/std@v0.51.0/path/posix.ts": "https://deno.land/std@v0.62.0/path/posix.ts",
    "https://deno.land/std@v0.50.0/path/win32.ts": "https://deno.land/std@v0.62.0/path/win32.ts",
    "https://deno.land/std@v0.50.0/path/posix.ts": "https://deno.land/std@v0.62.0/path/posix.ts"

Run your app again with "--reload". Done.

@fzn0x
Copy link
Contributor

fzn0x commented Jul 30, 2020

I had this problem after updating in a script which uses only Deno dependencies. I had to refresh the cache by running the deno cache command above. I figured it was a catching issue but wasn't sure how to resolve it. Thanks @fauzan121002

if this command don't help you at all , you guys can try this after upgrade the deno version and fix incompatible packages :
deno run -A --unstable --reload server.ts

@angelmtztrc
Copy link

I have the same problem, this happens when I import my database connection file (denodb) in my index.ts. When I run the script this is this the output:

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/x/dex@1.0.2/lib/deps/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/x/dex@1.0.2/lib/deps/path/posix.ts:433:18

Found 2 errors.

I already tried most of the options they comment, but none of them work, I even installed version 1.2.0 but it still does not work

@Soremwar
Copy link
Contributor

@angel-codes Looks like Dex made the terrible decision of copy-pasting Deno's std modules into their code, instead of importing them.

This modules are unstable, and with a recent bug fix in the definition of the URL api, also incompatible with Deno version 1.2+.

In order to fix this, downgrade to Deno 1.1.3 or lower or open an issue in Dex to fix the module. (Would be easy to make if he/she hadn't pushed the dependencies alongside the repo)

@salemalem
Copy link

salemalem commented Nov 21, 2020

In my case I'm using import map to manager my packages (--importmap=package.json), so I added the following lines:

How to use importmap?

@Soremwar
Copy link
Contributor

@shreyasrkulkarni
Copy link

I have the newer version of deno 1.10.3 and when I am trying to use command , deno run --allow-net --config=tsconfig.json index.ts I get following error.

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@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

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Response,

  at https://deno.land/x/oak@v4.0.0/deps.ts:9:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Cookies,
~~~~~~~
  at https://deno.land/x/oak@v4.0.0/deps.ts:20:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Cookie,
~~~~~~
  at https://deno.land/x/oak@v4.0.0/deps.ts:21:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
ApplicationOptions,
at https://deno.land/x/oak@v4.0.0/mod.ts:5:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
ListenOptions,

  at https://deno.land/x/oak@v4.0.0/mod.ts:6:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
ListenOptionsBase,
at https://deno.land/x/oak@v4.0.0/mod.ts:7:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
ListenOptionsTls,

  at https://deno.land/x/oak@v4.0.0/mod.ts:8:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
State,
~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:9:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
CookiesGetOptions,
at https://deno.land/x/oak@v4.0.0/mod.ts:14:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
CookiesSetDeleteOptions,

  at https://deno.land/x/oak@v4.0.0/mod.ts:15:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { compose as composeMiddleware, Middleware } from "./middleware.ts";
                                     ~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:18:40

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Body,
~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:20:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
BodyOptions,
~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:21:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
BodyOptionsAsReader,
~~~~~~~~~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:22:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
BodyReader,
~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:23:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
BodyType,
~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:24:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
RouteParams,
~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:29:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Route,
~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:30:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
RouterContext,
~~~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:32:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
RouterMiddleware,
~~~~~~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:33:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { HTTPMethods } from "./types.ts";
       ~~~~~~~~~~~
  at https://deno.land/x/oak@v4.0.0/mod.ts:36:10

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
RouterContext,
~~~~~~~~~~~~~
  at https://deno.land/x/dactyl@v0.1.0-alpha/deps.ts:6:3

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Middleware,
~~~~~~~~~~
  at https://deno.land/x/dactyl@v0.1.0-alpha/deps.ts:9:3

Found 25 errors.

@kitsonk
Copy link
Contributor

kitsonk commented Jun 2, 2021

@shreyasrkulkarni The version of the dependencies you are using (e.g. oak) do not work with 1.10.3. You need to update your dependencies or downgrade your version of Deno.

@kitsonk
Copy link
Contributor

kitsonk commented Jun 2, 2021

Actually looking at it dactyl seems to be the problem... you are using the latest version but it was published on 30/07/2020, 05:29:12 and it is using a load of stuff that isn't compatible with 1.10.3. You either need to get the package maintainer to update the library to work with current Deno, or downgrade your Deno version, or don't use dactyl, but it is an issue for dactyl not an issue with Deno.

@shreyasrkulkarni
Copy link

shreyasrkulkarni commented Jun 2, 2021

Actually looking at it dactyl seems to be the problem... you are using the latest version but it was published on 30/07/2020, 05:29:12 and it is using a load of stuff that isn't compatible with 1.10.3. You either need to get the package maintainer to update the library to work with current Deno, or downgrade your Deno version, or don't use dactyl, but it is an issue for dactyl not an issue with Deno.

Thanks for the reply @kitsonk . I dropped the idea of using dactyl and started working on oak and denodb. It did work fine until I used the Relationships concept in the denodb. Here is the actual problem:-
eveningkid/denodb#266
Can you please take a look at it ? It would really help me a lot. Also please tell me what is the command to update std dependencies from '0.51.0' to '0.61.0' .Thanks in advance.

@faridvatani
Copy link

Happened to me which imports from std@0.98.0. A simple deno upgrade to 1.11.0 fixed this for me.

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