OK I have read through the last three
OK, I have read through the last three months of discord and searched, and am still coming up empty.
I am using itty-router-openapi to serve paths. I have only been getting KV pairs and that seems to work just fine in my worker. I would like to get a Durable Object called User:
My routing code is in a file called "index.mts" where the User Object itself is stored in the following path:
/paths/Durables/User
I have imported the User Object in to index.mts:
import {User} from "./paths/Durables/User";
I have exported that same file from the same piece of code:
export {User} from "./paths/Durables/User"
I have exported the class from the file itself:
export default class User extends createDurable({ autoReturn: true }) {
I keep getting the same error:
Cannot create binding for class User that is not exported by the script7 Replies
Worth noting, when I start wrangler dev, I get the following error:
service core:user:worker: Uncaught ReferenceError: src_exports is not defined
Do you have a repo I can check out?
Let me create one
GitHub
GitHub - shrinerp/CF-Proxy
Contribute to shrinerp/CF-Proxy development by creating an account on GitHub.
I left all of my extra imports in there, but removed the "path" that I tried in my durable object binding.
I tried that in both index.mts and UserLookup where the object is used.
The error points back to the binding.
Cannot create binding for class User that is not exported by the script [code: 10061]
Which if the class isn't exporting, then CF won't know what to do with it.
Made some progress, I changed the binding to v3
That was the issue. Thanks for everyone help looking into this.