Cloudflare Worker Durable Object URL Binding Issue - TypeError: Invalid URL

For Workes & Pages, what is the name of the domain?

mysti-chat.workers.dev

What is the error message?

“TypeError: Invalid URL: [object JsRpcProperty]/registerUser”

What is the issue or error you’re encountering

'm facing an issue where my Cloudflare Worker is supposed to communicate with a Durable Object, but I’m getting a TypeError: Invalid URL. The Durable Object class is MatchManagerNew, and the main worker is supposed to send a fetch request to register and manage users for a chat application. I suspect that the Durable Object’s URL might not be properly generated or there is a mistake in the binding process between the Worker and the Durable Object. I followed the example to use RPC-style interactions but continue to receive the same URL-related error.

What steps have you taken to resolve the issue?

Created a Durable Object class and bound it using wrangler.toml.
Used migration tags to delete the previous class (MatchManager) and add a new one (MatchManagerNew).
Updated the worker script to make sure the Durable Object was being invoked correctly.
Re-deployed multiple times, but the Invalid URL error persists.

What are the steps to reproduce the issue?

Create a Durable Object.
Bind the Durable Object to a worker using wrangler.toml.
Attempt to make an RPC call from the worker to the Durable Object using fetch().
Observe the error in the logs indicating an invalid URL.

Screenshot of the error

Hi there,

It seems you code is not correctly replacing [object JsRpcProperty] with the URL, but to know exactly what is happening we would need to check the code.

Take care.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.