deligenius / multiparser

multipart/form-data parser for Deno servers
28 stars 7 forks source link

Outdated hardcoded std lib dep #9

Closed teleclimber closed 3 years ago

teleclimber commented 3 years ago

Trying to use this but I get the following error:

error: TS2345 [ERROR]: Argument of type 'import("https://deno.land/std@0.74.0/http/server").ServerRequest' is not assignable to parameter of type 'import("https://deno.land/std@0.61.0/http/server").ServerRequest'.
  Types of property 'r' are incompatible.
    Type 'import("https://deno.land/std@0.74.0/io/bufio").BufReader' is not assignable to type 'import("https://deno.land/std@0.61.0/io/bufio").BufReader'.
      Types have separate declarations of a private property 'buf'.
    const form = await multiParserV2(req, {})

It seems the lib hard-codes the std lib in mod.ts, and it has not been updated since 0.61. Current version appears to be 0.74.

danopia commented 3 years ago

Interesting, I'm not seeing the same type error.

I'm using these versions:

export { serve, ServerRequest } from "https://deno.land/std@0.83.0/http/server.ts";
export { multiParser } from 'https://deno.land/x/multiparser@v2.0.3/mod.ts'

though I also tried std@0.74.0 and that type checked as well. I wonder if it was a Deno internal problem that got fixed? If you're still seeing this, what's your Deno version?

gjuoun commented 3 years ago

updated multiparser@v2.1.0 to support std@0.89.0