diff --git a/.changeset/ten-numbers-rush.md b/.changeset/ten-numbers-rush.md new file mode 100644 index 000000000000..2b332b6c9157 --- /dev/null +++ b/.changeset/ten-numbers-rush.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Adds an error when running on Stackblitz, since `workerd` doesn't support it diff --git a/.github/ISSUE_TEMPLATE/---01-bug-report.yml b/.github/ISSUE_TEMPLATE/---01-bug-report.yml index 5184530e0065..8999cbe4da18 100644 --- a/.github/ISSUE_TEMPLATE/---01-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/---01-bug-report.yml @@ -42,7 +42,7 @@ body: id: bug-reproduction attributes: label: Link to Minimal Reproducible Example - description: 'Use [StackBlitz](https://astro.new/repro) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)' + description: 'Use [StackBlitz](https://astro.new/repro) (does not support `@astrojs/cloudflare`) or [GitHub](https://astro.new/minimal?on=github) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions).' placeholder: 'https://stackblitz.com/abcd1234' validations: required: true diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index 71048175ce1e..00e85627721d 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -60,6 +60,10 @@ export default function createIntegration(args?: Options): AstroIntegration { name: '@astrojs/cloudflare', hooks: { 'astro:config:setup': ({ command, config, updateConfig, logger, addWatchFile }) => { + if (!!process.versions.webcontainer) { + throw new Error('`workerd` does not run on Stackblitz.') + } + let session = config.session; if (args?.imageService === 'cloudflare-binding') {