#! rendives.nl

1 messages · Page 1 of 1 (latest)

analog umbraBOT
sly tapir
#

Hi there

buoyant herald
#

Hey!

#

I researched it and it is because you have to have an export default, where should i put it here? Because the docs don't mention it

sly tapir
#

Well each Component in a React app needs an export

#

So you would basically just put this at the bottom

#

I'm not that familiar with Next.JS specifically though

buoyant herald
sly tapir
#

Yeah it should be your Component usually

#

Like export default WebhookComponent

buoyant herald
#

Thats not possible i think, that gives the error Expression expected

#

if i put export default in front of the app.post i get a response error InternalServerError: stream is not readable i didn't get this without it

sly tapir
#

Overall this isn't really a Stripe issue and not something I can really help you with

buoyant herald
sly tapir
#

Sure thing

buoyant herald
#

i got it to work

sly tapir
#

Nice!

buoyant herald
#

its kinda weird, so the first one succeeds with 200, but then i get the error and it fails error - uncaughtException: Error: listen EADDRINUSE: address already in use :::3000 no idea why

sly tapir
#

That seems like your server is trying to boot multiple times at that route

buoyant herald
#

sudo lsof -i tcp:3000 logs this when it fails:

firefox   350 maurijnvd  526u  IPv4 0xc2ef5ab6950b06af      0t0  TCP localhost:60365->localhost:hbci (ESTABLISHED)
node    65890 maurijnvd   23u  IPv6 0xc2ef5ab68e71a317      0t0  TCP *:hbci (LISTEN)
node    65890 maurijnvd   42u  IPv6 0xc2ef5ab68e719797      0t0  TCP localhost:hbci->localhost:60365 (ESTABLISHED)
#

but when it succeeds it logs the same

sly tapir
#

When you say "it fails" what do you mean exactly

#

Like you are trying to send an Event to your endpoint and then seeing that error?

buoyant herald
sly tapir
#

So you receive the first Event successfully

buoyant herald
#

okey so if i remove

export const config = {
  api: {
    bodyParser: false,
  },
};
``` from my code it erros with 500 and if i put it back it works
#

at first i thought it was random but its with this