exports.cloudflare.ts is not picked up correctly
Author: KTrain5169Created Sep 22, 2026Updated Sep 25, 2026
Labelsenhancementpreset:cloudflarev3
Environment
Nitro 3.0.260903-beta Vite 8.3.0 Node.js v24.18.0
config:
{
serverDir: ".",
// Use node-server preset for dev, cloudflare-module for production
preset: "cloudflare-module",
cloudflare: {
nodeCompat: true,
exports: './exports.cloudflare.ts'
},
devServer: {
runner: "miniflare",
},
// Don't try to render static files
renderer: undefined,
experimental: {
tasks: true,
},
// Runs the retention purge in tasks/scheduled.ts every night
scheduledTasks: {
"0 3 * * *": "scheduled",
},
}Reproduction
- Setup a new project (I'm using the Vite plugin) and set it to deploy to Cloudflare with
cloudflare_modulepreset - Create an
exports.cloudflare.tsfile and export a class that extendsDurableObjectfromcloudflare:workers - attempt to start the Vite dev server
- Starts "successfully", but the error below appears.
Describe the bug
When using the cloudflare_module preset, my exports.cloudflare.ts file is not getting picked up and exported by Nitro. This then causes Miniflare to fail with a message about the Durable Object class being exported (likely also would apply to something like Workflows & other stuff that usually have a class exported from the main entrypoint)
Additional context
No response
Logs
workerd/server/server.c++:3354: warning: A DurableObjectNamespace in the config referenced the class "Coordinator", but no such Durable Object class is exported from the worker. Please make sure the class name matches, it is exported, and the class extends 'DurableObject'. Attempts to call to this Durable Object class will fail at runtime, but historically this was not a startup-time error. Future versions of workerd may make this a startup-time error.Source: nitrojs/nitro