for that you need to use the import from cloudflare:workers
for that you need to use the import from cloudflare:workers
"types": ["@cloudflare/workers-types"]wrangler typeswrangler dev?yarn preview script, here's how it's defined in package.json

--config flag? It’s documented in other places as doing what you want herepnpm wrangler whoami has the same problem TCP6:[::1]:8976 but now without a redirect url the whole thing breaks downwrangler dev --remote. This works fine.wrangler dev --remote the DO is evicted (including persistent storage) every few seconds and on every save of a file. This is a known issue (https://github.com/cloudflare/workers-sdk/issues/2700) that Cloudflare closed as 'not planned'. I see that using wrangler dev --local works alright for DO.npm create cloudflare@latest -- --type openapiEnv interface is not recognized in other parts of the code...
update for SPA mode was intended to do, but the worker code is not being invoked at all..newUniqueId to generate cookie values, then using .idFromString to read them, this fails when my worker is reloaded. (this would be done specifying uniqueKey in workerd, i think: https://github.com/cloudflare/workerd/blob/main/src/workerd/server/workerd.capnp#L554)"not_found_handling": "single-page-application"assets_navigation_prefers_asset_serving compat flag that was enabled by default on April 1st. Now, if requests include the Sec-Fetch-Mode: navigate header, which happens on page navigation, and in SPA mode, the index.html or 404.html is served, instead of the Worker being invoked. await (await fetch('/api/hello')).json(), you'll see the expected response, and the Worker get invoked.assets_navigation_has_no_effect to your compatibility_flags
Using redirected Wrangler configuration.
- Configuration being used: "dist/my_react_app/wrangler.json"
- Original user's configuration: "wrangler.jsonc"
- Deploy configuration file: ".wrangler/deploy/config.json""types": ["@cloudflare/workers-types"] type RecipeAgent = Rpc.DurableObjectBranded & {
test: () => Promise<void>;
};There is a deploy configuration at ".wrangler/deploy/config.json".
But the redirected configuration path it points to, "build/server/wrangler.json", does not exist.compatibility_date = "2025-02-10"
compatibility_flags = ["nodejs_compat"]
assets = { directory = "./build/client" }
main = './src/entry.worker.ts'yarn preview "preview": "yarn build && wrangler dev",
"build": "react-router build",import type { DurableObject } from 'cloudflare:workers';
declare global {
namespace Dependencies {
interface RecipeAgent extends DurableObject<unknown> {
test: () => Promise<void>;
}
type RecipeAgentNamespace = DurableObjectNamespace<RecipeAgent>;
}
}