Skip to content

C3: Error when an unsupported platform is specified for a framework#10695

Merged
dario-piotrowicz merged 5 commits into
mainfrom
dario/DEVX-2195/c3-error-unsupported-platform
Sep 18, 2025
Merged

C3: Error when an unsupported platform is specified for a framework#10695
dario-piotrowicz merged 5 commits into
mainfrom
dario/DEVX-2195/c3-error-unsupported-platform

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Fixes https://jira.cfdata.org/browse/DEVX-2195

Currently providing an invalid platform via the --platform argument for a framework causes the option to simply be ignored, this makes C3 create the application using the supported framework's platform instead, this can be surprising and confusing to users, so as a DX improvement here I am updating C3 to hard-error instead.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is a self explanatory change
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not a Wrangler change

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner September 18, 2025 11:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: 730970a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/create-cloudflare/e2e/tests/cli/cli.test.ts Outdated
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Sep 18, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10695

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10695

miniflare

npm i https://pkg.pr.new/miniflare@10695

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10695

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10695

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10695

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10695

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10695

wrangler

npm i https://pkg.pr.new/wrangler@10695

commit: 730970a


frameworkConfig = frameworkConfig.platformVariants[platform];
} else {
if (frameworkConfig.platform !== args.platform) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Coudn't args.platform be undefined ?
I think it is --platform=<args.platform> so not required?

Could the else if be a elseif (provided it is still possible after potential changes are applied)

Copy link
Copy Markdown
Member Author

@dario-piotrowicz dario-piotrowicz Sep 18, 2025

Choose a reason for hiding this comment

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

Coudn't args.platform be undefined ?

Yes I've addressed that 🙂

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.

Could the else if be a elseif (provided it is still possible after potential changes are applied)

Switched to else if 👍

Comment thread packages/create-cloudflare/e2e/tests/cli/cli.test.ts Outdated
Comment on lines +533 to +534
throw new Error(
`The ${frameworkConfig.displayName} framework doesn't support the "${args.platform}" platform`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the previous version passed the tests then we have a hole in the coverage and we should add a test.

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.

Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Thanks Dario!

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Sep 18, 2025
@dario-piotrowicz dario-piotrowicz merged commit bde8ef2 into main Sep 18, 2025
34 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/DEVX-2195/c3-error-unsupported-platform branch September 18, 2025 14:45
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants