#rodrigo702
1 messages · Page 1 of 1 (latest)
Hi i'm not familiar with sveltekit, is this error related to sveltekit or Stripe?
Can you share with me the full error log?
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJSONFromBytes (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:580:15)
at successSteps (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:520:23)
at specConsumeBody (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:529:5)
at Request.json (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:368:14)
at POST (/Users/rodrigomarquez/sonix-web/src/routes/api/stripeCheckout/+server.ts:11:39)
at Module.render_endpoint (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/@sveltejs+kit@1.22.3_svelte@4.1.1_vite@4.4.7/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:49:24)
at resolve (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/@sveltejs+kit@1.22.3_svelte@4.1.1_vite@4.4.7/node_modules/@sveltejs/kit/src/runtime/server/respond.js:409:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.respond (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/@sveltejs+kit@1.22.3_svelte@4.1.1_vite@4.4.7/node_modules/@sveltejs/kit/src/runtime/server/respond.js:279:20)
Have you checked the network response and verify if the response from your server is a valid JSON object?
I get a 500 error on my browser and a failed to load resource. Im still pretty new to dvelopment so Im not sure if thats what you mean
Sometimes I get this too
SyntaxError: Unexpected token 'M', "Montly=249" is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:580:15)
at successSteps (/Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/body.js:520:23)
at /Users/rodrigomarquez/sonix-web/node_modules/.pnpm/undici@5.22.1/node_modules/undici/lib/fetch/util.js:821:56
at node:internal/process/task_queues:140:7
at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
SyntaxError: Unexpected token 'M', "Montly=249" is not valid JSON this clearly tells you where the error is, you might want to check the relevant code.
I have tried for hours, I am not sure where it clearly says where the error is. I do not have "Montly=249" anywhere in my project. Any help I can get is appreciated
I won't be much of help here because the error is from your project, perhaps you want discuss it with your team?
What do you mean by its from my project tho?? I sent all the code I have that has to do with stripe...