Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-planets-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes wrangler config template in `astro add cloudflare` to use correct entrypoint and compatibility date
17 changes: 7 additions & 10 deletions packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,17 @@ export default async function seed() {
`,
CLOUDFLARE_WRANGLER_CONFIG: (name: string) => `\
{
"main": "dist/_worker.js/index.js",
"compatibility_date": ${JSON.stringify(new Date().toISOString().slice(0, 10))},
"compatibility_flags": ["global_fetch_strictly_public"],
"name": ${JSON.stringify(name)},
"compatibility_date": ${JSON.stringify(new Date().toISOString().slice(0, 10))},
"compatibility_flags": [
"nodejs_compat",
"global_fetch_strictly_public"
],
"main": "@astrojs/cloudflare/entrypoints/server",
"assets": {
"binding": "ASSETS",
"directory": "./dist"
"directory": "./dist",
"binding": "ASSETS"
},
"observability": {
"enabled": true
}
"enabled": true
}
}`,
CLOUDFLARE_ASSETSIGNORE: `_worker.js\n_routes.json`,
};
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/cloudflare/src/wrangler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function defaultCloudflareConfig(): PluginConfig['config'] {
// TODO: better way to handle name, maybe package.json#name ?
name: 'test-application',
compatibility_date: '2025-05-21',
compatibility_flags: ['global_fetch_strictly_public'],
main: '@astrojs/cloudflare/entrypoints/server',
assets: {
directory: './dist',
Expand Down