diff --git a/.changeset/khaki-shirts-deliver.md b/.changeset/khaki-shirts-deliver.md new file mode 100644 index 0000000..2aae847 --- /dev/null +++ b/.changeset/khaki-shirts-deliver.md @@ -0,0 +1,7 @@ +--- +"@opennextjs/cloudflare": patch +--- + +fix: delete init.cache rather than assign undefined + +Assigning undefined to init.cache throws when using NextAuth diff --git a/packages/cloudflare/src/cli/build/bundle-server.ts b/packages/cloudflare/src/cli/build/bundle-server.ts index 6af72db..81b5eed 100644 --- a/packages/cloudflare/src/cli/build/bundle-server.ts +++ b/packages/cloudflare/src/cli/build/bundle-server.ts @@ -94,7 +94,7 @@ fetch = globalThis.fetch; const CustomRequest = class extends globalThis.Request { constructor(input, init) { if (init) { - init.cache = undefined; + delete init.cache; // https://github.com/cloudflare/workerd/issues/2746 // https://github.com/cloudflare/workerd/issues/3245 Object.defineProperty(init, "body", {