Hey, I can't make a new durable object : ``` Cannot create binding for class 'Trainer' because it i

Hey, I can't make a new durable object :
Cannot create binding for class 'Trainer' because it is not currently configured to implement durable objects. Did you forget to apply a --new-class migration to it? [code: 10061]
Cannot create binding for class 'Trainer' because it is not currently configured to implement durable objects. Did you forget to apply a --new-class migration to it? [code: 10061]
But if I try to add it
npx wrangler deploy --new-class Trainer
✘ [ERROR] Unknown arguments: new-class, newClass
npx wrangler deploy --new-class Trainer
✘ [ERROR] Unknown arguments: new-class, newClass
In my wrangler I have
[[durable_objects.bindings]]
name = "DURABLE_TRAINER"
class_name = "Trainer"
[[migrations]]
tag = "v1"
new_classes = ["Trainer"]
[[durable_objects.bindings]]
name = "DURABLE_TRAINER"
class_name = "Trainer"
[[migrations]]
tag = "v1"
new_classes = ["Trainer"]
I already did it once and then I deleted my durable object via dashboard, how to remake one ?
14 Replies
Hello, I’m Allie!
Try just running wrangler deploy
Noah
NoahOP2mo ago
Yeah that's what gives me
Cannot create binding for class 'Trainer' because it is not currently configured to implement
durable objects. Did you forget to apply a --new-class migration to it? [code: 10061]
Cannot create binding for class 'Trainer' because it is not currently configured to implement
durable objects. Did you forget to apply a --new-class migration to it? [code: 10061]
and I tried with different wrangler version, currently i'm on 3.78.12
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Noah
NoahOP2mo ago
Well I finally resolved the issue by deleting the existing worker, made a new worker with different name, then migrate my page on the new worker But ty! I'll try
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Yota
Yota2mo ago
Thanks but I have read all the materials you guys provided. The reason why doing this is to remove errors. I understand that. But what I am saying is that only one read should not consume this number of read because it does not make sense to scan other tables when I just want to get one row. FYI, there is no foreign key in every 8 tables and there are only 6 records in total I will try researching good indices anyway. Thanks for the answer.
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Yota
Yota2mo ago
Cool 😎 thank you for the info!
Isaac McFadyen
Isaac McFadyen2mo ago
Just an addendum here in case anyone sees this in the future that this is for typing only - if the row isn't actually a User no error will be thrown, it will show as a User to Typescript but not actually be a User object 😄
1.1.1.1
1.1.1.12mo ago
DNS over Discord: GitHub
View the DNS over Discord source code on GitHub at https://dns-over-discord.v4.wtf/github
Suman!
Suman!2mo ago
Hi guys, Is the latency between the Worker and the Durable object expected to be around 100-160ms provided that they both are in the same location?
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Hello, I’m Allie!
AFAIK, no, but it doesn’t have to, since the storage is synchronous anyway
Want results from more Discord servers?
Add your server