
Cannot create binding for class in script 'worker-A' that does not exist [code: 10061]data.set("settings", JSON.stringify({ bindings }));data is a FormData objectmethodX(), I get this error:The name of the entrypoint to bind to. If you do not specify an entrypoint, the default export of the Worker will be used.
Cannot create binding for class in script 'worker-A' that does not exist [code: 10061]data.set("settings", JSON.stringify({ bindings }));methodX()The RPC receiver does not implement the method "methodX"✔ script to run › worker:dev-local
$ wrangler dev
⛅️ wrangler 3.84.0
-------------------
Using vars defined in .dev.vars
Your worker has access to the following bindings:
- Workflows:
- SEARCH_WORKFLOW: SearchWorkflow
- TEST_WORKFLOW: TestWorkflow
- Services:
- TEST_SERVICE: 🔴 test-service#TestService
- Vars:
- TURSO_TOKEN: "(hidden)"
- TURSO_URL: "(hidden)"
- WEBSHARE_PROXY_URL: "(hidden)"
- CLOUDFLARE_ACCOUNT_ID: "(hidden)"
- CLOUDFLARE_ACCESS_KEY_ID: "(hidden)"
- CLOUDFLARE_SECRET_ACCESS_KEY: "(hidden)"
▲ [WARNING] This worker is bound to live services: TEST_SERVICE (test-service#TestService)
[wrangler:inf] Ready on http://localhost:8787
⎔ Starting local server...
✘ [ERROR] The Workers runtime failed to start. There is likely additional logging output above.
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose# wrangler.toml B
name = "worker-B"
# ...
[env.dev.durable_objects]
bindings = [
{ name = "DO", class_name = "Do", script_name="worker-A" }
]# wrangler.toml A
name = "worker-A"
# ...
[env.dev.durable_objects]
bindings = [
{ name = "DO", class_name = "Do" }
]
[[migrations]]
tag = "v1"
new_sqlite_classes = ["Do"]compatibility_date = "2024-10-22"
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
entrypoint = "StorageService"compatibility_date = "2024-10-22"
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
entrypoint = "StorageService"export class StorageService extends WorkerEntrypoint<Bindings> {
async methodX() {
// stuff happens here
}
}
export default {
async fetch() {
return new Response("Hello world");
}
}compatibility_date = "2024-10-22"
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"export default class StorageService extends WorkerEntrypoint<Bindings> {
async methodX() {
// stuff happens here
}
}const response = await env.AI.run(
("@hf/meta-llama/meta-llama-3-8b-instruct",
payload
);
return new Response(response, {
headers: {
"content-type": "text/event-stream",
},
});