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

Reading Buffer when input is a rawBody string #371

Closed
dvanmali opened this issue Apr 6, 2023 · 6 comments
Closed

Reading Buffer when input is a rawBody string #371

dvanmali opened this issue Apr 6, 2023 · 6 comments

Comments

@dvanmali
Copy link

dvanmali commented Apr 6, 2023

Environment

Issue did not exist in v1.6.2

Reproduction

[request error] [unhandled] [500] The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise

Describe the bug

When type is buffer, the buffer should parse the buffer. When type is _rawBody, use string as-is.

Additional context

No response

Logs

No response

@chrisspiegl
Copy link

Thank you for mentioning this. I saw your pull request but couldn't apply the patch. Knowing that it works with v1.6.2, I used pnpm to override the h3 version in my project and got things working on firebase.

The override is necessary for firebase deploy since sub dependencies will get the current version of h3 and thus I had to kinda force it to use v1.6.2.

package.json:

{ 
  "dependencies": {
    "h3": "1.6.2"
  },
  "pnpm": {
    "overrides": {
      "h3": "1.6.2"
    }
  }
}

@timb-103
Copy link

Having the same issue, @chrisspiegl solution worked.

@Skwai
Copy link

Skwai commented Apr 13, 2023

Just encountered same issue and fix. 1.6.2 worked.

@brunomoyse
Copy link

same problem, thank you @chrisspiegl for the work around waiting for the merge

@pi0
Copy link
Member

pi0 commented Jun 20, 2023

HI. This should have been fixed in latest h3 releases. Please let me know to investigate if you can still reproduce.

@pi0 pi0 closed this as completed Jun 20, 2023
@pi0
Copy link
Member

pi0 commented Jan 3, 2024

Another related fix for form-data requests (firebase parses them as json in req.body): #604

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

No branches or pull requests

6 participants