DO + pages
You need a second Worker, also running dev
12 Replies
You mean like multiple
wrangler dev
calls?Yup
i see! so my repo directory structure should be like:
essentially a module (with
package.json
+ wrangler.toml
inside a subdirectory of my Pages repo)
ah, figured it out!Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
yep! i was able to get a worker in the pages deploy to bind to a durable object, both locally and remotely
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
haha, that's what i did too, using the discord search function scoped to the #durable-objects channel 🙂
I think this is demonstrable proof that DO and DO+Pages needs better documentation...
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Yes, and no, not necessarily
Basically, the Worker is only needed to publish the DO class. It doesn't need any of the normal Worker logic. It could be as simple as Notice the lack of
export default
This also means that you can bind directly to the DO from your Functions, and not have to invoke the Worker itself at allUnknown User•14mo ago
Message Not Public
Sign In & Join Server To View
What if you do
Oh wait
Bundle it first, then change the main
Or just add an to the file
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View