Skip to content

Conversation

rmarscher
Copy link
Contributor

@rmarscher rmarscher commented Mar 1, 2025

Fixes #7594.

Adding a C3 template for Waku, a minimal React framework. https://waku.gg/

@rmarscher rmarscher requested a review from a team as a code owner March 1, 2025 17:03
@rmarscher rmarscher requested a review from a team March 1, 2025 17:03
Copy link

changeset-bot bot commented Mar 1, 2025

🦋 Changeset detected

Latest commit: 14de58a

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 Minor

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

@workers-devprod workers-devprod added the c3-e2e Run c3 e2e tests on a PR label Mar 1, 2025
@rmarscher rmarscher force-pushed the c3-framework-experimental-waku branch 4 times, most recently from 8aa5ca3 to d1ff8ba Compare March 2, 2025 06:49
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Mar 6, 2025
Copy link
Contributor

github-actions bot commented Mar 6, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-wrangler-8314

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8314/npm-package-wrangler-8314

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-wrangler-8314 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-workers-bindings-extension-8314 -O ./cloudflare-workers-bindings-extension.0.0.0-veb635466b.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-veb635466b.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-create-cloudflare-8314 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-kv-asset-handler-8314

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-miniflare-8314

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-pages-shared-8314

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-unenv-preset-8314

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-vite-plugin-8314

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-vitest-pool-workers-8314

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-workers-editor-shared-8314

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-workers-shared-8314

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13699747655/npm-package-cloudflare-workflows-shared-8314

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.113.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250224.0
workerd 1.20250224.0 1.20250224.0
workerd --version 1.20250224.0 2025-02-24

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@rmarscher rmarscher force-pushed the c3-framework-experimental-waku branch 2 times, most recently from 0f68d70 to ce7fa61 Compare March 6, 2025 13:25
@@ -0,0 +1,24 @@
#:schema node_modules/wrangler/config-schema.json
Copy link
Contributor

Choose a reason for hiding this comment

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

would you be able to make this a wrangler.jsonc? for consistency :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely! I didn't see that the other templates started migrating. I'll get that updated in the Cloudflare Waku template and also rebase to fix the new conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. That is all set in this PR. I also submitted an upstream PR to switch to wrangler.jsonc and to recognize an existing toml, json or jsonc file. wakujs/waku#1301

@rmarscher rmarscher force-pushed the c3-framework-experimental-waku branch from ce7fa61 to 9d9952b Compare March 8, 2025 06:41
dai-shi pushed a commit to wakujs/waku that referenced this pull request Mar 8, 2025
Cloudflare is using jsonc as the default config format for their
templates:
[workers-sdk#8314](cloudflare/workers-sdk#8314 (review)).

https://developers.cloudflare.com/workers/wrangler/configuration/
@petebacondarwin
Copy link
Contributor

Sorry this has sat here for a while. Would you mind resolving the conflicts?

@rmarscher rmarscher force-pushed the c3-framework-experimental-waku branch 5 times, most recently from 853784c to d3cb44a Compare April 7, 2025 16:41
@rmarscher
Copy link
Contributor Author

Sorry this has sat here for a while. Would you mind resolving the conflicts?

No problem. Thank you for looking at it. I think this is ready for review.

@emily-shen emily-shen added the skip-pr-description-validation Skip validation of the required PR description format label Apr 15, 2025
Copy link
Contributor

github-actions bot commented Apr 15, 2025

A Wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-wrangler-8314
Prereleases for other packages:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-workers-bindings-extension-8314 -O ./cloudflare-workers-bindings-extension.0.0.0-vc581b4f4c.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vc581b4f4c.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-create-cloudflare-8314 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-kv-asset-handler-8314

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-miniflare-8314

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-pages-shared-8314

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-unenv-preset-8314

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-vite-plugin-8314

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-vitest-pool-workers-8314

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-workers-editor-shared-8314

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-workers-shared-8314

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14462527551/npm-package-cloudflare-workflows-shared-8314

Note that these links will no longer work once the GitHub Actions artifact expires.

Copy link
Contributor

@emily-shen emily-shen left a comment

Choose a reason for hiding this comment

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

lgtm for the most part! thanks for your patience, hopefully we can get this out soon 🧡

would you be able to add a changeset, fix the tests and run pnpm fix to fix the linting issues? let me know if you'd like a hand with any of these :)

@penalosa penalosa force-pushed the c3-framework-experimental-waku branch from 899784f to 3f57a0a Compare September 10, 2025 11:03
@petebacondarwin petebacondarwin force-pushed the c3-framework-experimental-waku branch 6 times, most recently from 7e9890a to 8431f5d Compare September 29, 2025 07:25
rmarscher and others added 4 commits September 29, 2025 09:54
Fixes cloudflare#7594.

Adding a C3 template for Waku, a minimal React framework. https://waku.gg/

- Tests
  - [ ] TODO (before merge)
  - [x] Tests included
  - [ ] Tests not necessary because:
- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
  - [ ] I don't know
  - [x] Required
  - [ ] Not required because:
- Public documentation
  - [ ] TODO (before merge)
  - [x] Cloudflare docs PR(s): <cloudflare/cloudflare-docs#20444>
  - [ ] Documentation not necessary because:
@petebacondarwin petebacondarwin force-pushed the c3-framework-experimental-waku branch from 8431f5d to 1c28fc1 Compare September 29, 2025 08:54
@petebacondarwin
Copy link
Contributor

I've been trying to land this over the weekend.
But it appears that there is no a legitimate issue in the Waku build (as demonstrated by the failed CI jobs).

  create-cloudflare:test:e2e: > waku build --with-cloudflare
  create-cloudflare:test:e2e: vite v7.0.5 building SSR bundle for production...
  create-cloudflare:test:e2e: transforming...
  create-cloudflare:test:e2e: "sqlite" is imported by "sqlite?commonjs-external", but could not be resolved – treating it as an external dependency.
  create-cloudflare:test:e2e: ✓ 525 modules transformed.
  create-cloudflare:test:e2e: ✗ Build failed in 11.19s
  create-cloudflare:test:e2e: node:internal/modules/run_main:123
  create-cloudflare:test:e2e:     triggerUncaughtException(
  create-cloudflare:test:e2e:     ^
  create-cloudflare:test:e2e: 
  create-cloudflare:test:e2e: Could not resolve "./node.js" from "node_modules/blake3-wasm/esm/index.js"
@rmarscher
Copy link
Contributor Author

I've been trying to land this over the weekend. But it appears that there is no a legitimate issue in the Waku build (as demonstrated by the failed CI jobs).

I will look into it @petebacondarwin. I haven't encountered that build error before. First thing we can try is updating create-waku to the latest version (0.12.5-0.26.1-0).

@rmarscher
Copy link
Contributor Author

rmarscher commented Sep 29, 2025

Updating create-waku did not seem to fix it. I am reproducing the error running the e2e test locally using

E2E_FRAMEWORK_TEMPLATE_TO_TEST=waku pnpm test:e2e -F create-cloudflare -- frameworks

When I run that command, it seems to wait forever on the waku (workers) step of e2e/tests/frameworks/frameworks.test.ts. I found the log file at packages/create-cloudflare/.e2e-logs/pnpm/frameworks/waku_workers.ansi and that shows that it failed to build and run the preview with the same error message.

🎉  SUCCESS  Application created successfully!
💻 Continue Developing
Change directories: cd c3-tests-e2e--web-frameworksuU34hY/tmp-e2e-c374d3d6a0-waku--workers
Start dev server: pnpm run dev
Deploy: pnpm run deploy
📖 Explore Documentation
https://developers.cloudflare.com/workers
🐛 Report an Issue
https://github.com/cloudflare/workers-sdk/issues/new/choose
💬 Join our Community
https://discord.cloudflare.com

Running command: pnpm run preview --port 55354

> tmp-e2e-c374d3d6a0-waku--workers@0.0.0 preview /private/tmp/c3-tests-e2e--web-frameworksuU34hY/tmp-e2e-c374d3d6a0-waku--workers
> pnpm run build && wrangler dev "--port" "55354"
> tmp-e2e-c374d3d6a0-waku--workers@0.0.0 build /private/tmp/c3-tests-e2e--web-frameworksuU34hY/tmp-e2e-c374d3d6a0-waku--workers
> waku build --with-cloudflare
vite v7.1.5 building SSR bundle for production...
transforming...
"sqlite" is imported by "sqlite?commonjs-external", but could not be resolved – treating it as an external dependency.
✓ 513 modules transformed.
✗ Build failed in 12.87s
node:internal/modules/run_main:122
    triggerUncaughtException(
    ^

Could not resolve "./node.js" from "node_modules/.pnpm/blake3-wasm@2.1.5/node_modules/blake3-wasm/esm/index.js"

But if I cd into the temp dir in the logs (/private/tmp/c3-tests-e2e--web-frameworksuU34hY/tmp-e2e-c374d3d6a0-waku--workers), I can run pnpm run preview --port 55354 without any errors and the scaffolded app is working at http://localhost:55354/.

So I'm not exactly sure why it is failing with e2e. It looks like the default node version on my machine right now is v22.12.0.

@petebacondarwin
Copy link
Contributor

I'll take a look...

@petebacondarwin
Copy link
Contributor

I can reproduce the error in e2e locally. But also create a new project locally that works. Same as you. I am using Node 20.
So I am also not sure what is happening.

@rmarscher
Copy link
Contributor Author

I compared environment variables and found that NODE_ENV=test causes this problem with the Waku / Vite setup. Adding NODE_ENV=production to the build command fixes it. I'll raise an upstream issue, but hopefully this unblocks getting this PR landed. Thank you so much for all of your help.

@petebacondarwin petebacondarwin merged commit 7e0d750 into cloudflare:main Sep 29, 2025
33 of 34 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Sep 29, 2025
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Sep 29, 2025
Copy link

holopin-bot bot commented Sep 29, 2025

Congratulations @rmarscher, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmg5k2y2i0024l704mur2mxvs

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c3-e2e Run c3 e2e tests on a PR contribution [Holopin] Recognizes an open-source contribution, big or small skip-pr-description-validation Skip validation of the required PR description format

7 participants