cmorten / opine

Minimalist web framework for Deno ported from ExpressJS.
https://github.com/cmorten/opine/blob/main/.github/API/api.md
MIT License
854 stars 43 forks source link

/react and /dejs examples are broken #44

Closed FaberVitale closed 4 years ago

FaberVitale commented 4 years ago

Issue

How to reproduce

  1. Update deno to 1.2.1.
  2. Run deno run -A /examples/dejs/index.ts or deno run -A /examples/react/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@v0.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@v0.51.0/path/posix.ts:433:18

Found 2 errors.

Details

Updating dejs to 0.8.0 fixes the issue.

$ deno --version
deno 1.2.1
v8 8.5.216
typescript 3.9.2

Sidenote

External dependencies in /examples should be consolidated either with an importMap or using a ./examples/deps.ts file, see https://github.com/asos-craigmorten/opine/issues/41.