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

Bug on deno std, or opine ??? #147

Closed waghanza closed 2 years ago

waghanza commented 2 years ago

Hi @asos-craigmorten,

Trying to add opine to https://github.com/the-benchmarker/web-frameworks. I am facing the following error

error: TS2339 [ERROR]: Property 'getIterator' does not exist on type 'ReadableStream<R>'.
  return res.readable.getIterator();
                      ~~~~~~~~~~~
    at https://deno.land/std@0.69.0/async/pool.ts:45:23

Setup:

Source code:

import { opine } from "https://deno.land/x/opine@1.9.0/mod.ts";

const app = opine();

app.get("/", function (_, res) {
  res.send("");
});

app.get("/user/:id", (req, res) => {
    res.end(req.params.id);
})

app.post("/user", (_, res) => {
    res.end("");
})

app.listen("0.0.0.0:3000");

Regards,

yacinehmito commented 2 years ago

I've just been hit by the same issue.

cmorten commented 2 years ago

@waghanza @yacinehmito

Hey folks 👋

Thanks for flagging this - hopefully https://deno.land/x/opine@1.9.1 resolves the issue. Please reopen if otherwise!

I suspect Opine will benchmark fairly low on that list 😅 contrary to efforts on the Deno std lib, with Opine the focus was always feature support over performance... perhaps should try to remedy that 🤔 awesome to hear that you're trying to get Deno projects onto that list though! 🚀

saipasha commented 2 years ago

Thank you for the fast action. I just ran into the same issue.

yacinehmito commented 2 years ago

Thank you very much.