Error importing `cloudflare:workers`
I am trying to use a Cloudflare Durable Object in development. This requires
import { DurableObject } from "cloudflare:workers";
, which fails with the following error:
5 Replies
absent-sapphireOP•2mo ago
This is on version 1.128.1 with
target: "cloudflare-module"
absent-sapphireOP•2mo ago
I've created an issue + minimal repro here:
https://github.com/TanStack/router/issues/4687
GitHub
Can't find module "cloudflare:workers" when using `target: 'cloudfl...
Which project does this relate to? Start Describe the bug Create a project with target: 'cloudflare-module' and add a CloudFlare durable object class. I have created a minimal repo based on...
absent-sapphireOP•2mo ago
If anyone knows where in the code to start, I would love to help fix this
magic-amber•2mo ago
I'm facing this right now and my fix was this. It took an hour to get to this point, what a pain 😣

magic-amber•2mo ago
The error only shows on the frontend logs, not on server logs. And it says
Uncaught TypeError: error loading dynamically imported module
I've also put it in the issue