From c7a5743c45e4ea2a36c819bc2c67f071fc7cec23 Mon Sep 17 00:00:00 2001 From: Alex Chiu Date: Sun, 12 May 2024 05:03:56 +0100 Subject: [PATCH] fix cloudflare build error - https://github.com/withastro/astro/issues/11005 --- astro.config.mjs | 12 +++++++++++- wrangler.toml | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index c82e9e2..32a26f4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,5 +10,15 @@ export default defineConfig({ actions: true, }, integrations: [react()], - adapter: cloudflare(), + vite: { + ssr: { + external: ["node:async_hooks"], + }, + }, + adapter: cloudflare({ + platformProxy: { + enabled: true, + configPath: "wrangler.toml", + }, + }), }); diff --git a/wrangler.toml b/wrangler.toml index 96b529e..9cdca7e 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,4 +1,6 @@ -node_compat = true +name = "fullstack-astro-cloudflare" +compatibility_date = "2024-04-19" +compatibility_flags = ["nodejs_compat"] # [[d1_databases]] # binding = "DB"