You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a worker that defines a Durable Object (but doesn't export it in the main file), a very cryptic error is thrown
service core:user:my-worker: Uncaught TypeError: Class extends value undefined is not a constructor or null
at index.js:1648:44 in maskDurableObjectDefinition
at index.js:1657:26
✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
We should probably check whether the main script exports the DO, and if it doesn't, provide an easier to understand error.
Please provide a link to a minimal reproduction
exportdefault{}// note, the lack of `export class MyDO`
name = "my-worker"script = "src/index.ts"compatibility_date = "2023-08-11"
[[durable_objects.bindings]]
name = "MY_DO"class_name = "MyDO"
[[migrations]]
tag = "v1"new_classes = ["MyDo"]
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered:
I am also getting this error in a nextjs project after doing a next-on-pages build but I am already exporting the class
@Meai that sounds like a different issue - this is purely for improving the messaging when you're not exporting the DO. As a side note, I don't believe pages supports Durable Objects within Functions - you'd have to bind to a separate worker
I am also getting this error in a nextjs project after doing a next-on-pages build but I am already exporting the class
@Meai that sounds like a different issue - this is purely for improving the messaging when you're not exporting the DO. As a side note, I don't believe pages supports Durable Objects within Functions - you'd have to bind to a separate worker
Have this changed recently @Skye-31 . I think pages do support Durable Objects now. It would be great to see a good example of how to export a DO class correctly?
Which Cloudflare product(s) does this pertain to?
Wrangler core, Other
What version(s) of the tool(s) are you using?
Wrangler 3.5.0
What version of Node are you using?
18.17.0
What operating system are you using?
Mac
Describe the Bug
When creating a worker that defines a Durable Object (but doesn't export it in the main file), a very cryptic error is thrown
We should probably check whether the main script exports the DO, and if it doesn't, provide an easier to understand error.
Please provide a link to a minimal reproduction
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: