Deno: Execute deno on empty dir, wrong error message.

Created on 16 Aug 2020  路  9Comments  路  Source: denoland/deno

So i was forgot to change directory, into directory that contain index.ts.
i am not aware that i was execute
deno run -A --unstable index.ts on empty dir...

and i got this error message, so i thought the problem is on my apps

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/[email protected]/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/[email protected]/path/posix.ts:433:18

Found 2 errors.

Most helpful comment

You should be importing [email protected]. Also make sure you are on Deno v1.3.0. (run deno upgrade to update)

All 9 comments

deno info --no-check your_entry_file.js

Better suited for discord though Deno discord

and if we execute this command in empty directory :

deno run -A --unstable index.ts

the error above also coming

You should be importing [email protected]. Also make sure you are on Deno v1.3.0. (run deno upgrade to update)

You sure the dir is empty? Cause then it should throw because index.ts doesn't exist

yes on my windows OS, it does not return wrong error message like above so i was confused.

You should be importing [email protected]. Also make sure you are on Deno v1.3.0. (run deno upgrade to update)

yes its the newest version. i change the title and problem

Can you run dir on the folder you say it's empty? Also try to do echo $DENO_DIR and navigate to the folder it outputs

make sure you are on [email protected]. The log clearly states you are on an old version of std

Do you have any other dependencies? Maybe one of those also depends on [email protected], use deno info mod.ts to see a full dependency list

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

somombo picture somombo  路  3Comments

zugende picture zugende  路  3Comments

ry picture ry  路  3Comments