diff --git a/.changeset/hungry-islands-fly.md b/.changeset/hungry-islands-fly.md new file mode 100644 index 000000000..000d4d49c --- /dev/null +++ b/.changeset/hungry-islands-fly.md @@ -0,0 +1,5 @@ +--- +"inngest": patch +--- + +Do not swallow JSON parsing errors when syncing diff --git a/packages/inngest/src/components/InngestCommHandler.ts b/packages/inngest/src/components/InngestCommHandler.ts index d7acdb20e..8a83892f1 100644 --- a/packages/inngest/src/components/InngestCommHandler.ts +++ b/packages/inngest/src/components/InngestCommHandler.ts @@ -1141,6 +1141,7 @@ export class InngestCommHandler< data = await res.json(); } catch (err) { this.log("warn", "Couldn't unpack register response:", err); + throw err; } const { status, error, skipped, modified } = registerResSchema.parse(data); diff --git a/packages/inngest/src/test/helpers.ts b/packages/inngest/src/test/helpers.ts index 687b86f7e..5a4116c8c 100644 --- a/packages/inngest/src/test/helpers.ts +++ b/packages/inngest/src/test/helpers.ts @@ -606,7 +606,7 @@ export const testFramework = ( describe("env detection and headers", () => { test("uses env headers from client", async () => { - nock("https://api.inngest.com").post("/fn/register").reply(200); + nock("https://api.inngest.com").post("/fn/register").reply(200, {}); const ret = await run( [