Repository navigation
[vite-plugin] Treat cloudflare:durable-objects as a built-in module - #16452
apeacock1991 wants to merge 1 commit into
Conversation
Durable Object methods are marked as safe to retry with `retryable()` from the `cloudflare:durable-objects` runtime module. Add it to the plugin's built-in module list so Vite leaves the import for workerd instead of resolving it as a package. Wrangler already treats every `cloudflare:*` import as external.
🦋 Changeset detectedLatest commit: 5fdf3c8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
LGTM! |
|
✅ Approved — A small, targeted fix that adds The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed📋 Code Quality: ✅ LGTMThe change adds This review did not check whether the workerd version the playground uses exports 📝 Documentation: ✅ LGTMThe changeset accurately describes the fix. No further documentation is needed for this bug fix. Reviewed commit: |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
Workers can import
retryable()fromcloudflare:durable-objectsto mark Durable Object methods as safe to retry. The Vite plugin keeps its own list of runtime modules, and this one wasn't on it, sovite build(andcf deploy) failed with:This adds
cloudflare:durable-objectstocloudflareBuiltInModules, so Vite leaves the import for workerd. Wrangler already marks everycloudflare:*import as external, and the Vitest plugin falls back to workerd forcloudflare:*builtins, so neither needs a change.The module-resolution playground now imports
retryableand checks it's a function. I ran it in serve and build mode. With the list entry removed, the build variant fails with the error above.