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/ten-numbers-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': patch
---

Adds an error when running on Stackblitz, since `workerd` doesn't support it
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---01-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/integrations/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any docs for this? I found various references to it on GitHub but no documentation.

I noticed std-env also check process.env.SHELL but no idea what matters where.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah not documented AFAIK, the info comes from Stackblitz team directly

throw new Error('`workerd` does not run on Stackblitz.')
}

let session = config.session;

if (args?.imageService === 'cloudflare-binding') {
Expand Down