-
Notifications
You must be signed in to change notification settings - Fork 45
[BUG] Build Fails Due to Missing Durable Object Classes in Worker Configuration #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide a reproduction. There is nothing we can do from this |
Looks like |
One more thing open-next.config.ts
But then in On-Demand Revalidation when you select doShardedTagCache you need to change it to this configuration
So incrementalCache changes Is that right? However, I have tried both options, it does not solve the current problem |
Remove |
Yes, removing But when using this configuration
I get this error
wrangler log
reproduction is here https://github.com/eposha/opennext-cloudflare-r2-cache-issue |
@james-elicx any idea ? |
I created cloudflare/workers-sdk#8687 for the |
Thanks. The R2 issue was a problem with npm and yarn due to how CLI flags are passed around. It should have been fixed by #505, which was released in 0.6.2. |
hi @james-elicx PR #505 is make my build broken with error:
I use yarn and npm on Windows and Cloudflare CI both of them throwing same error. I use npm 10.9.2, yarn 4.5.0, node v22 |
HI @muhamad-rizki, please can you share a reproduction? I'm unable to reproduce this locally. |
sure here you go https://github.com/muhamad-rizki/cfnextjs-repro
|
Thanks, yeah, this looks like a difference between how yarn classic and yarn modern work. I was testing with yarn classic earlier, but I can reproduce with yarn modern. Have raised #512 to fix. |
The DO part of the issue will be fixed with cloudflare/workers-sdk#8697 that should land in wrangler next week. Meanwhile you can add a |
Hello, I got into the same issue. Has this been fixed? I tried to add the "script_name" workaround as mentioned by @vicb but then i got into a new error when deploying: "Cannot apply new-class migration to class 'DurableObjectQueueHandler' that is not exported by script." |
@zoroblox What did you put as |
Hi @conico974, thank you for your reply. I initially put the "script_name": "My worker name" in the wrangler.jsonc - I tried to replaced it as "script_name": ".open-next/worker.js" as you suggested. But i got into the same error when i tried to deploy using "npm run deploy" as below. Can you please help me on how to fix it: Your worker has access to the following bindings:
✘ [ERROR] A request to the Cloudflare API (/accounts/.../workers/scripts/...) failed. Cannot apply new-class migration to class 'DurableObjectQueueHandler' that is not exported by If you think this is a bug, please open an issue at: |
@zoroblox Could you share your |
@conico974 Here is my wrangler.jsonc file. I'm trying to create a next js app with prisma connecting to supabase. If i removed the durable objects bindings, the deployment works but i can't use next js caching. Can you please look into it
|
|
@zoroblox You tried setting it to |
@conico974 My bad, i'm so sorry. I updated |
I'm still having the same issue, also with This is my wrangler.toml: name = "..."
main = ".open-next/worker.js"
compatibility_date = "2025-04-01"
compatibility_flags = [ "nodejs_compat" ]
upload_source_maps = true
placement = { mode = "smart" }
[[routes]]
pattern = "..."
custom_domain = true
[assets]
directory = ".open-next/assets"
binding = "ASSETS"
[vars]
VAR = "..."
[observability]
enabled = true
head_sampling_rate = 1
[[kv_namespaces]]
binding = "NEXT_CACHE_WORKERS_KV"
id = "..."
[[services]]
binding = "WORKER_SELF_REFERENCE"
service = "..."
[[durable_objects.bindings]]
name = "NEXT_CACHE_DO_QUEUE"
class_name = "DurableObjectQueueHandler"
script_name = ".open-next/worker.js"
[[migrations]]
tag = "v1"
new_sqlite_classes = ["DurableObjectQueueHandler"]
[[d1_databases]]
binding = "NEXT_TAG_CACHE_D1"
database_name = "OpennextTagCache"
database_id = "..."
This is what I get in the build:
If that could be useful the project is a monorepo and the Next.js website is inside the |
@ibobo use the name of your app, not |
@conico974 Thank you, it works that way. For anyone looking into this: name = "app_name"
#...
[[durable_objects.bindings]]
name = "NEXT_CACHE_DO_QUEUE"
class_name = "DurableObjectQueueHandler"
script_name = "app_name" |
@ibobo you shouldn't need |
I confirm now |
Describe the bug
When attempting to create an optimized production build, the process fails due to missing Durable Object classes in the worker configuration. The following warnings and errors are encountered:
Steps to reproduce
wrangler.json
open-next.config.ts
Expected behavior
Fix
@opennextjs/cloudflare version
0.6.0
Wrangler version
4.5.0
next info output
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0; Binaries: Node: 23.5.0 npm: 10.9.2 Yarn: N/A pnpm: 9.15.4 Relevant Packages: next: 15.2.4 eslint-config-next: 15.2.4 react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: