fhsinchy/deno-blog

Getting type error Type 'URL' is not assignable to type 'string'.

mwoodpatrick opened this issue · 2 comments

When trying to build this I'm getting:

Check file:///home/mwoodpatrick/projects/git/deno/deno-blog/bin/server.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@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

Found 2 errors.

I'm not sure how to debug this

@mwoodpatrick Try bumping upward all the package versions listed in /deps.ts. You'll want to avoid modules which load/use std@.51.0 as .61 is latest.

Then run the deno app again, this time with -r flag to reload the modules. Something like: deno run -A -r ./bin/server.js

Many thanks for response, much appreciated.

I used udd to update deps.ts it gave the updates:

	https://deno.land/x/mysql@2.1.0/mod.ts 2.1.0 -> v2.3.0
	https://deno.land/x/djwt@v0.9.0/create.ts v0.9.0 -> v1.1
	https://deno.land/x/bcrypt@v0.2.1/mod.ts v0.2.1 -> v0.2.3
	https://deno.land/x/djwt@v0.9.0/validate.ts v0.9.0 -> v1.1
            https://deno.land/x/oak@v4.0.0/mod.ts v4.0.0 -> v6.0.1

This seems to be working,