-
-
Notifications
You must be signed in to change notification settings - Fork 765
feat(cloudflare): add durable.bindingName config #3875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@onmax is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds configurable Durable Object binding name for Cloudflare via a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-12-03T19:09:13.905ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/presets/cloudflare/utils.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-03T19:09:13.905Z
Learnt from: medz
Repo: nitrojs/nitro PR: 3834
File: src/presets/cloudflare/server-entry.ts:63-63
Timestamp: 2025-12-03T19:09:13.905Z
Learning: In the Nitro Cloudflare preset (src/presets/cloudflare/server-entry.ts), native errors from oxc-parser and Node.js readFile operations should be allowed to bubble up naturally without wrapping, as their native error messages are more user-friendly and provide better diagnostic information.
Applied to files:
src/presets/cloudflare/utils.ts
Summary
Adds
cloudflare.durable.bindingNameconfig option to customize the Durable Object binding name used bydefineWebSocketHandler.Before: Hardcoded
$DurableObjectbinding nameAfter: Configurable via
nitro.cloudflare.durable.bindingNameChanges
cloudflare.durable.bindingName(default:$DurableObject)durable_objectsin wrangler.json whendeployConfig: trueUsage
With
deployConfig: true, wrangler.json auto-includes:{ "durable_objects": { "bindings": [{ "name": "MyDO", "class_name": "$DurableObject" }] } }Reproduction
Reproduction with pnpm patch: https://github.com/onmax/repros/tree/main/nitro-3378
Related
cloudflare_durableWebSockets broken in preview;cloudflare_moduleinconsistent on Workers nuxt-hub/core#722cloudflare_durablepreset #3378