-
Notifications
You must be signed in to change notification settings - Fork 742
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
🐛 BUG: wrangler pages dev with proxy command does not expose durable objects to qwik #3622
Comments
From digging into the Each instance of {
"my-durable-objects-worker": {
"protocol": "http",
"mode": "local",
"port": 8787,
"host": "127.0.0.1",
"durableObjects": [
{ "name": "MY_DURABLE_OBJECT", "className": "MyDurableObject" }
],
"durableObjectsHost": "127.0.0.1",
"durableObjectsPort": 8787
}
} You need to specify the full In the above example, you'd do: wrangler pages dev --do MY_DURABLE_OBJECT=MyDurableObject@my-durable-objects-worker ... |
Hey! 👋 Apologies for the delayed response here. Accessing bindings whilst still using framework dev servers is something we're actively looking at improving. @dario-piotrowicz is currently working on something for Next.js, but we're exploring ideas for other frameworks too. 👍 |
Unfortunately same issue with SvelteKit and the instructions from the docs do not work, nor do I get a list mentioned by @mayfieldiv when I navigate to http://localhost:6284/workers. Although my worker is running but the list appear empty. |
I finally was able to get the DurableObject work to show up in the worker registry. Apparently the worker must have default export with fetch handler. Though DurableObject is not available to vite when calling |
fwiw, that's what is also required in sveltekit projects to make a D1 binding available to a locally running version of the build.
|
Have a look at this. I got sveltekit dev to work locally using cf-bindings-proxy for Cloudflare D1 |
hi folks, lots of things to unpack in this issue, so will do my best to answer everything. 1. Pages + Durable Objects Today, Pages cannot define/deploy a Durable Object itself. In order to use Durable Objects with Pages, the DO needs to be defined inside a separate Worker. Once this Worker is deployed, you can reference that Durable Object in your Pages project in three ways:
We are aware that our docs around using DOs in Pages could be better, and we are working on that. We are also aware that folks could use more helpful examples/demos/tutorials around this topic, and we will be working on that as well. In the meanwhile, while not ideal, this fixture in the 2. Pages proxy command We are aware that this is not an optimal user experience, but we are hoping to make improvements/address as part of this milestone. I hope that these details are helpful, but happy to provide more clarifications if needed. I empathise with the friction of getting all this to work, so would really love to help y'all <3. In the meanwhile closing as won't fix, as proxy command is deprecated. |
Which Cloudflare product(s) does this pertain to?
Pages
What version(s) of the tool(s) are you using?
wrangler 3.2.0
What version of Node are you using?
v18.16.1
What operating system are you using?
WSL (openSUSE leap 15.5)
Describe the Bug
I want to use
qwik
framework together with durable objects. When I usecreate-cloudflare
to create an app with qwik, it adds the following topackages.json
:This works great (sans durable objects). I was able to track down that the way to develop durable objects with pages locally is to connect to an existing worker:
So. Using
populates the
platform.env
key in a qwik request handler and I can see my durable object (along withASSETS: Fetcher
):However - this requires the project to be prebuilt into
dist
folder. That way I use all thevite
niceness inqwik
. I have tried to combine the the two - using proxy with the--do
option but that does not work for me (theenv
key inplatform
is not set).The output during startup suggests that the durable object is made available, but the
platform.env
is undefined.Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: