avi
03/25/2023, 10:50 PMwot
03/25/2023, 10:57 PMavi
03/26/2023, 1:10 AMavi
03/26/2023, 1:11 AMwrangler pages dev --local --do=COUNTER=Counter -- vite dev
HardAtWork
03/26/2023, 7:24 AMckoeninger
03/27/2023, 2:37 PMavi
03/27/2023, 10:03 PMckoeninger
03/27/2023, 10:20 PMckoeninger
03/27/2023, 10:21 PMfour33
03/27/2023, 11:39 PM--do THING=Thing
to wrangler pages dev
but all I get is a DurableObjectError [ERR_CLASS_NOT_FOUND]
.
I'm basically trying to add a binding for durable objects to a Pages/Functions projectfour33
03/27/2023, 11:43 PM--do Durable Object to bind (--do NAME=CLASS) [array]
Where does this class export live? I've tried putting it in the pages function, in the functions directory, in the src/ directory and at the rootmhazy
03/28/2023, 12:51 AMWalshy | Pages
03/28/2023, 12:53 AMWalshy | Pages
03/28/2023, 12:53 AMmhazy
03/28/2023, 12:56 AMUnsmart | Tech debt
03/28/2023, 1:09 AMHardAtWork
03/28/2023, 6:14 AMwrangler dev
session which declares the DOjan
03/28/2023, 9:21 AMPlayer
DO class. I'm running wrangler dev
inside the worker repo, but running wrangler pages dev --do players=Player
in my pages project yields DurableObjectError [ERR_CLASS_NOT_FOUND]: Class "Player" for Durable Object "player" not found
. I'm assuming I'm either doing something wrong when running the pages command, or maybe the worker's wrangler.toml
is missing something? The worker itself works fine when I publish it, and the DO appears as possible bindings in the pages dashboard. Is there anything else I should do to "declare the DO" locally? Appreciate any pointers you might have 😊HardAtWork
03/28/2023, 9:23 AMsh
wrangler pages dev --do players=Player@WorkerScriptName
, and replace WorkerScriptName
with the name of the script that exposes your Player
DO class.jan
03/28/2023, 9:27 AMfour33
03/28/2023, 1:01 PMfour33
03/28/2023, 1:02 PMwrangler pages dev
with the --do
flag.four33
03/28/2023, 3:04 PM--do
flag, but my context.env
doesn't contain that Durable Object namespacefour33
03/28/2023, 3:20 PMwrangler dev --local
HardAtWork
03/28/2023, 3:21 PMfour33
03/28/2023, 3:23 PMfour33
03/28/2023, 3:23 PMwrangler dev --local
from my workerHardAtWork
03/28/2023, 3:32 PM{}
four33
03/28/2023, 3:43 PMfour33
03/28/2023, 3:44 PMconsole.log(context.env)
{
KV_NAMESPACE: KVNamespace,
SOME_ENV_VAR: 'abc123',
DO_NAMESPACE: DurableObjectNamespace
}
etc