deno-api-starter-oak icon indicating copy to clipboard operation
deno-api-starter-oak copied to clipboard

Error when running

Open giggio opened this issue 5 years ago • 3 comments

I just tried running the app and got an error:

❯ deno run --allow-read --allow-net --unstable app.ts
Check file:///p/examples/deno-api-starter-oak/app.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/[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.

I'm on the latest Deno version:

❯ deno --version
deno 1.3.1
v8 8.6.334
typescript 3.9.7

But it seems maybe that the Standard Library has changed? I just tried the container and it still builds and runs.

giggio avatar Aug 23 '20 21:08 giggio

Ok, I found it, it is related to the latest Deno and stdlib: https://github.com/denoland/deno/issues/6755 I got it to work, I'll learn more about this sample, if I can get it to work I'll send a PR.

giggio avatar Aug 23 '20 21:08 giggio

You can see what I changed here: https://github.com/giggio-samples/deno-api-starter-oak/commit/a66ba95ea8aaa0f0dc0ce4812b15d17a8171f8fc Apart from the change on the .env file, would you like me to send a PR?

giggio avatar Aug 23 '20 23:08 giggio

@giggio please send PR, would be great to have more people contributing here.

asad-devx avatar Aug 30 '20 10:08 asad-devx