#maverickdoge_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1278060682037825628
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- maverickdoge_api, 3 hours ago, 7 messages
If you do payload.body do you get the same error?
What happens when you console.log(); request? Does it contain anything?
what happens if you just pass payload to constructEvent instead?
still getting type error since its expecting string but payload is type ReadableStream<Uint8Array>
Ah wait, why is it a Readable Stream though?
is the request being parsed somewhere before it hits your function?
It should be a buffer
you shouldn't do request.text
try request.rawBody
also asking the same question as above
is the request being parsed somewhere before it hits your function?
So the webhook is hitting directly the endpoint and the constructEvent func is getting params as u can see in the pics
if u mean parsing in the middleware than its not doing that
Correct. You only shared your code for Post function.. Where exactly are you calling this function?
middleware meaning if you're passing a body parser or something to your node server, that's a middleware
something that automatically converts incoming request body to let's say JSON
Can you share the code that configures your route?
So I am running it next js, I have a middleware running but that does not parse anything so the request should directly hit the function, so the request is the raw request
rawBody is a property, not a function
Guessing Next wraps Request object into it's own wrappers
So I tried that out, so now atleast now not getting error related to false params.
now the only error I am getting is for invalid body
do u maybe know about that?
What did you try out exactly?
I'm guessing you're passing something invalid to constructEvent
So I added the micro lib to read it as buffer and than providing that as string to constructEvent