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

useBody does not work on unenv direct call #8

Open
farnabaz opened this issue Aug 2, 2021 · 3 comments
Open

useBody does not work on unenv direct call #8

farnabaz opened this issue Aug 2, 2021 · 3 comments

Comments

@farnabaz
Copy link

farnabaz commented Aug 2, 2021

I'm not sure if here is the correct place to create an issue, feel to close/move it.

Using h3 useBody with localCall (with unenv) leads to forever waiting promise and as the cause API never return data. (req.on('end') never calls https://github.com/unjs/h3/blob/main/src/utils/body.ts#L27)

As a solution (since unenv set req.body), we can check for req.body inside useBody and use it as parsed body.

@pi0
Copy link
Member

pi0 commented Aug 3, 2021

Thanks for opening issue @farnabaz. Hmm not sure but maybe we can try emulating req : data/end events with unenv?

@ruslankonev
Copy link

Hi, any plan to release proposed pull request? When can we wait for a fix?

@pi0
Copy link
Member

pi0 commented Nov 24, 2021

Added workaround in latest version of h3 (0.3.5) until we fix root cause in unenv.

@pi0 pi0 transferred this issue from unjs/unenv Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants