Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

edmundhung
Copy link
Member

Fixes n/a.

Now that we have Dev registry support, the vite plugin should not crash on startup if it sees a service binding to a named entrypoint from an unknown worker:

AssertionError [ERR_ASSERTION]: unknown-worker does not match a worker name.
     at getWorkerToWorkerEntrypointNamesMap (file:///Users/edmund/Workspace/workers-sdk/packages/vite-plugin-cloudflare/dist/index.js:13514:9)
     at getDevMiniflareOptions (file:///Users/edmund/Workspace/workers-sdk/packages/vite-plugin-cloudflare/dist/index.js:13769:44)
     at async configureServer (file:///Users/edmund/Workspace/workers-sdk/packages/vite-plugin-cloudflare/dist/index.js:14644:37)
     at async _createServer (file:///Users/edmund/Workspace/workers-sdk/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:44149:20)
     at async CAC.<anonymous> (file:///Users/edmund/Workspace/workers-sdk/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/cli.js:750:20)

The dev registry will return a runtime error instead if it couldn't resolve an address for the unknown worker.


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: covered by fixture tests
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because: vite only change

@edmundhung edmundhung requested review from a team as code owners June 12, 2025 16:50
Copy link

changeset-bot bot commented Jun 12, 2025

🦋 Changeset detected

Latest commit: cb8211f

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin 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

Copy link

pkg-pr-new bot commented Jun 12, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: cb8211f

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 13, 2025
Copy link
Contributor

@jamesopstad jamesopstad left a comment

Choose a reason for hiding this comment

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

I just approved but if you could add an unknown service binding to the wrangler.jsonc in the worker playground that would be good. That way we'll catch regressions of this behaviour.

@edmundhung
Copy link
Member Author

edmundhung commented Jun 13, 2025

I just approved but if you could add an unknown service binding to the wrangler.jsonc in the worker playground that would be good. That way we'll catch regressions of this behaviour.

Added in cb8211f

@edmundhung edmundhung added this pull request to the merge queue Jun 13, 2025
Merged via the queue into main with commit 70ba9fb Jun 13, 2025
19 checks passed
@edmundhung edmundhung deleted the edmundhung/vite-registry-named-entrypoint-support branch June 13, 2025 17:56
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 13, 2025
jseba added a commit to jseba/workers-sdk that referenced this pull request Jun 14, 2025
* 'main' of ssh://github.com/cloudflare/workers-sdk: (213 commits)
  fix(vite-plugin-cloudflare): allow unknown entrypoint on startup (cloudflare#9583)
  add warning about env not specified to potentially risky wrangler commands (cloudflare#9344)
  test: correctly delete test d1 databases (cloudflare#9598)
  Add details to v3 maintenance worflow error message (cloudflare#9602)
  drop unused `WRANGLER_UNENV_RESOLVE_PATHS` env var (cloudflare#9593)
  warn instead of erroring if no exposed ports. and remove unused dev_exposed_ports (cloudflare#9573)
  fix(wrangler): point to the right doc location (replaces cloudflare#9353) (cloudflare#9592)
  [vitest-pool-worker] Add `type: module` in package.json (cloudflare#9595)
  Enable HTML handling for HTML files in the public directory (cloudflare#9548)
  switch from go container to js (cloudflare#9588)
  containers: switch to Cloudflare container registry (cloudflare#9564)
  performance improvement: restart a mixed mode session only if the worker's remote bindings have changed (cloudflare#9536)
  ci: delete more orphaned resources from e2e tests (cloudflare#9580)
  test: remove `verifyBuildScript` logic from c3 e2e tests (cloudflare#9504)
  fix(vite-plugin): ensure node compat globals are injected before any imports (cloudflare#9581)
  feat(containers-shared): Move `isDockerfile` utility function to `containers-shared` (cloudflare#9577)
  allow `startWorker` to accept `false` as an `inspector` option (to disable the inspector server) (cloudflare#9550)
  Update capnp generated code from the workerd.capnp (cloudflare#9582)
  Bump `@cloudflare/unenv-preset` to 2.3.3 (cloudflare#9566)
  test: make custom build bundling tests more robust (cloudflare#9494)
  ...
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.

2 participants