Oren
Oren•5mo ago

http action as webhook is not working

json {"code":"[Request ID: c3a345772419092f] Server Error: Uncaught TypeError: Request URL is undefined","trace":"Uncaught TypeError: Request URL is undefined\n at <anonymous> (../../convex/renders.ts:137:22)\n at async invokeFunction (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/impl/registration_impl.ts:79:11)\n at async invokeHttpAction (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/impl/registration_impl.ts:422:0)\n at async HttpRouter.runRequest (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/router.ts:322:16)\n"}
json {"code":"[Request ID: c3a345772419092f] Server Error: Uncaught TypeError: Request URL is undefined","trace":"Uncaught TypeError: Request URL is undefined\n at <anonymous> (../../convex/renders.ts:137:22)\n at async invokeFunction (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/impl/registration_impl.ts:79:11)\n at async invokeHttpAction (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/impl/registration_impl.ts:422:0)\n at async HttpRouter.runRequest (../../node_modules/.pnpm/convex@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/convex/src/server/router.ts:322:16)\n"}
7 Replies
Oren
OrenOP•5mo ago
also body is undefined webhook is triggered from replicate
Oren
OrenOP•5mo ago
the log
No description
ballingt
ballingt•5mo ago
Do you know what this webhook request looks like? Can you repro this with a curl request, or can you point the replicate one at another server that will record the request? @Oren is this something that was working and stopped, or something you're setting up and isn't working?
Oren
OrenOP•5mo ago
hey just changed const {body} = await request.json(); from the docs to const body = await request.json(); and it works now body is the json 🤦 ty for your input
ballingt
ballingt•5mo ago
Where in the docs is that, sounds like it should be changed was it this
const { author, body } = await request.json();
const { author, body } = await request.json();
Oren
OrenOP•5mo ago
yes used that
ballingt
ballingt•5mo ago
Thanks, helpful to know this one can be confusing

Did you find this page helpful?