Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node:http2 doesn't export Http2ServerRequest and Http2ServerResponse #23326

Open
bartlomieju opened this issue Apr 11, 2024 Discussed in #23324 · 9 comments
Open

node:http2 doesn't export Http2ServerRequest and Http2ServerResponse #23326

bartlomieju opened this issue Apr 11, 2024 Discussed in #23324 · 9 comments
Labels
bug Something isn't working correctly node API polyfill Related to various "node:*" modules APIs node compat

Comments

@bartlomieju
Copy link
Member

Discussed in #23324

Originally posted by OnielN14 April 11, 2024
In the v1.42.2 I see latest compat update for node http2 is released. So I just try to run hono + @hono/node-server

import { serve } from "npm:@hono/node-server"
import { Hono } from "npm:hono"

const app = new Hono()
app.get("/", (c) => c.text("Hello from server"))

serve({
  fetch: app.fetch,
  port: 3000
}, () => {
  console.log("Running on 3000")
})

and it seems Http2ServerRequest is not available as named export.
here is the error message

error: Uncaught SyntaxError: The requested module 'http2' does not provide an export named 'Http2ServerRequest'
    at <anonymous> (file:https:///C:/Users/OnielN14/AppData/Local/deno/npm/registry.npmjs.org/@hono/node-server/1.9.1/dist/index.mjs:5:10)

am I missing something regarding node compatiblity?

Thanks

@bartlomieju
Copy link
Member Author

No particular reason, it's a bug.

@bartlomieju bartlomieju added bug Something isn't working correctly node compat node API polyfill Related to various "node:*" modules APIs good first issue Good for newcomers labels Apr 11, 2024
@clemg
Copy link

clemg commented Apr 15, 2024

Just exporting these two classes (here and here) won't make it work.
The response here will be empty

@bartlomieju
Copy link
Member Author

That's correct, @satyarohith is working on improving node:http2 module.

@jmj0502
Copy link

jmj0502 commented May 10, 2024

@bartlomieju Is this issue still open? I mean can I work on this? Is not entirely clear based on your last comment.

If so, I would like to give it a stab c:

@satyarohith
Copy link
Member

satyarohith commented May 11, 2024

@bartlomieju Is this issue still open? I mean can I work on this? Is not entirely clear based on your last comment.

If so, I would like to give it a stab c:

Hi, @jmj0502. Please go ahead. Note #23326 (comment)

@jmj0502
Copy link

jmj0502 commented May 11, 2024

@satyarohith cool!

Quick question? Should I work on the implementation describe on the initial consideration of the issue? or are there other changes to be considered for the issue in question? 🤔

@satyarohith
Copy link
Member

@satyarohith cool!

Quick question? Should I work on the implementation describe on the initial consideration of the issue? or are there other changes to be considered for the issue in question? 🤔

A good target is to get the example from description working with Deno. Exporting the unavailable methods isn't sufficient to get it working as mentioned here. I'm not entirely sure what exactly is required to get the example to work with Deno. We need to explore why the response is empty and what needs to be done.
The scope of it has increased after #23326 (comment) and I don't think it's a good first issue anymore. But I'm happy to help (You can send me Discord DM) if you're interested to dig deeper. :)

@satyarohith satyarohith removed the good first issue Good for newcomers label May 11, 2024
@jmj0502
Copy link

jmj0502 commented May 13, 2024

A good target is to get the example from #23326 (comment) working with Deno. Exporting the unavailable methods isn't sufficient to get it working as mentioned #23326 (comment). I'm not entirely sure what exactly is required to get the example to work with Deno. We need to explore why the response is empty and what needs to be done.
The scope of it has increased after #23326 (comment) and I don't think it's a good first issue anymore. But I'm happy to help (You can send me Discord DM) if you're interested to dig deeper. :)

@satyarohith Cool! I'm all up for it! Many thanks for offering your help, again I don't really know the codebase in depth, but I'll do my best to fix the issue in question.

I'll start by building the project and replicating the issue in question, then I'll proceed to send you a discord DM to further explain my plan of action and start diving deeper into the issue. Feel free to assign the issue to me if you consider it appropriate 👍

@EdamAme-x
Copy link

I also encountered the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node API polyfill Related to various "node:*" modules APIs node compat
Projects
None yet
Development

No branches or pull requests

5 participants