Skip to content
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

🐛 BUG: Cloudflare Worker Remix + Durable Object : MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start #6988

Closed
hawkup opened this issue Oct 15, 2024 · 3 comments
Labels
bug Something that isn't working

Comments

@hawkup
Copy link

hawkup commented Oct 15, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler, Miniflare, Other

What version(s) of the tool(s) are you using?

3.80.4

What version of Node are you using?

22.2.0

What operating system and version are you using?

macOS Sonoma 14.6.1

Describe the Bug

Observed behavior

When starting the development server or building the Cloudflare Worker Remix project with DO bindings, the following error occurs

service core:user:__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER: Worker "core:user:__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER"'s binding "Counter" refers to a service "core:user:worker", but no such service is defined.

Expected behavior

The project should start and build successfully with DO bindings, without any errors.

Steps to reproduce

  1. Clone the repository below or open this Codesandbox
  2. Run pnpm dev or pnpm build to reproduce the error.

This setup follows the Cloudflare Workers Remix Framework Guide, with additional DO binding configurations added to wrangler.toml.

[[durable_objects.bindings]]
name = "COUNTERS"
class_name = "Counter"

[[migrations]]
tag = "v1"
new_classes = ["Counter"]

Please provide a link to a minimal reproduction

https://github.com/hawkup/my-remix-app

Please provide any relevant error logs

service core:user:__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER: Worker "core:user:__WRANGLER_EXTERNAL_DURABLE_OBJECTS_WORKER"'s binding "Counter" refers to a service "core:user:worker", but no such service is defined.
MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/project/workspace/node_modules/.pnpm/miniflare@3.20241004.0/node_modules/miniflare/dist/src/index.js:9842:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (/project/workspace/node_modules/.pnpm/miniflare@3.20241004.0/node_modules/miniflare/dist/src/index.js:3627:16)
    at async #waitForReady (/project/workspace/node_modules/.pnpm/miniflare@3.20241004.0/node_modules/miniflare/dist/src/index.js:9899:5)
    at async Miniflare2._getProxyClient (/project/workspace/node_modules/.pnpm/miniflare@3.20241004.0/node_modules/miniflare/dist/src/index.js:10023:5)
    at async Miniflare2.getBindings (/project/workspace/node_modules/.pnpm/miniflare@3.20241004.0/node_modules/miniflare/dist/src/index.js:10042:25)
    at async getPlatformProxy (/project/workspace/node_modules/.pnpm/wrangler@3.80.4_@cloudflare+workers-types@4.20241011.0/node_modules/wrangler/wrangler-dist/cli.js:217375:20)
    at async configureServer (/project/workspace/node_modules/.pnpm/@remix-run+dev@2.13.1_@remix-run+react@2.13.1_typescript@5.6.3_vite@5.4.9_wrangler@3.80.4/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:55:11)
    at async _createServer (file:///project/workspace/node_modules/.pnpm/vite@5.4.9/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:63069:20)
    at async configResolved (/project/workspace/node_modules/.pnpm/@remix-run+dev@2.13.1_@remix-run+react@2.13.1_typescript@5.6.3_vite@5.4.9_wrangler@3.80.4/node_modules/@remix-run/dev/dist/vite/plugin.js:748:27) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
 ELIFECYCLE  Command failed with exit code 1.
@hawkup hawkup added the bug Something that isn't working label Oct 15, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Oct 15, 2024
@emily-shen
Copy link
Contributor

cc @edmundhung I think this is the durable object issue you were running into?

@edmundhung
Copy link
Member

Hi @hawkup,

Sorry for the unclear error message. The Remix vite dev environment uses a proxy via the getPlatformProxy API, which supports bindings in Node.js with limitations. Durable Objects are supported, but they must be defined in a separate Worker, with your Remix Worker pointing to it using the script_name configuration, and run in a different terminal via wrangler dev.

We understand the current limitations and are actively working to improve this experience. I hope this clarifies the issue—let me know if you still run into any problems.

@hawkup
Copy link
Author

hawkup commented Oct 16, 2024

@edmundhung Thank you so much. I followed your solution, the Remix worker is successfully invoking the other Durable Object worker. Everything runs and builds perfectly, so I’ll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants