#Is there a way to use Nitro 3 with my Nuxt app, today?
15 messages · Page 1 of 1 (latest)
Hi @jolly notch. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources provided, I can see there is an active work-in-progress PR (feat(deps): nitro v3) to integrate Nitro v3 into Nuxt, but it is not yet stable or officially released.
The knowledge sources do not contain enough information to confirm whether exports.cloudflare.ts (or custom durable objects support) is available or usable in any current Nuxt release. The PR is still marked as WIP with several open items.
What the roadmap says
Nuxt 5 is the planned release that will include the Nitro v3 upgrade, and it is currently scheduled for Q1 2026 (estimated). [Nuxt roadmap]
"Nuxt 5 which will include an upgrade to Nitro v3 and additional changes."
Can you use it today?
The knowledge sources do not provide a supported or recommended way to use Nitro v3 features (like exports.cloudflare.ts) in a current stable Nuxt app. The WIP PR (feat(deps): nitro v3) exists but is not yet merged or production-ready, and there are still open issues listed in it.
There is no documented workaround in the provided knowledge sources for your specific use case (custom Cloudflare Durable Objects via Nitro v3 exports). I'd recommend:
- Watching the WIP PR at nuxt/nuxt#33005 for progress.
- Waiting for the Nuxt 5 beta, which is the official path for Nitro v3 integration.
I'm sorry I can't give you a more actionable answer — the knowledge sources simply don't document a stable, recommended way to use Nitro v3 with Nuxt today.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@jolly notch Kapa.ai is still learning and improving, please let me know how I did by reacting below.
looking at https://github.com/nuxt/nuxt/pull/33005 @slender igloo it looks like it is merge and we can use future.compatibilityVersion: 5, so I guess using exports.cloudflare.ts (https://nitro.build/deploy/providers/cloudflare) and proper binding is now possible ?
Let me check the knowledge base for you again. One moment! :books:
You're right that the Nitro v3 upgrade work has progressed significantly. Based on the knowledge sources:
- The
future.compatibilityVersion: 5option is now available in Nuxt 4 (the current stable release as of 2025-07-16), and setting it opts your app into Nuxt v5 behaviour, including the Vite Environment API and other v5 changes. [Nuxt upgrade guide]
export default defineNuxtConfig({
future: {
compatibilityVersion: 5,
},
})
However, I need to be careful here: the knowledge sources do not explicitly confirm that exports.cloudflare.ts or custom Durable Objects bindings from Nitro v3 are available and working through this flag. The knowledge sources mention:
- Nitro v3 integration is part of the Nuxt 5 plan [Nuxt roadmap]
compatibilityVersion: 5enables Nuxt v5 behaviour including the Vite Environment API [Nuxt features guide]- There is also a note that Nitro auto-imports are disabled by default with
compatibilityVersion: 5, requiring eitherexperimental.nitroAutoImports: trueor explicit imports fromnitro/h3[Nitro auto-imports PR]
The knowledge sources do not contain enough detail about the specific exports.cloudflare.ts Nitro v3 feature or Durable Objects support to confirm whether that specific capability is accessible today via compatibilityVersion: 5. For that level of detail, I'd recommend checking the Nitro v3 Cloudflare deployment docs directly and the merged PR nuxt/nuxt#33005 for what's actually landed.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@mint light Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Yes, I confirm it works in nuxt nightly ! 🎉
@stoic pine noticed an issue with SSR in nuxt 5 nightly on Cloudflare, will investigate further later
- SSR crashes loading _build/server.mjs
Symptom: Any HTML page request returns 500. API routes work fine.
Root cause: Nuxt 5's SSR bundle (_build/server.mjs) fails to initialise when dynamically imported inside the Cloudflare Workers runtime. In miniflare (local dev) the error is TypeError: Cannot read properties of undefined (reading 'replace') at the line import.meta.url.replace(//app/.*$/, "/") — import.meta.url is undefined in miniflare for dynamically imported modules. In production CF Workers the failure is different but also fatal to SSR.
Workaround: ssr: false in nuxt.config.ts. The demo page (app/pages/index.vue) loads all data in onMounted, so client-side rendering is identical in behaviour. API routes are unaffected.
- Nitro auto-imports not available in route files
Symptom: ReferenceError: defineEventHandler is not defined at runtime in the Worker.
Root cause: With future.compatibilityVersion: 5, Nitro's auto-import injection is disabled. Route files that use defineEventHandler, createError, getRouterParam, readBody, etc. without explicit imports fail at runtime in the CF Workers module scope (they compile fine because rolldown bundles them as unresolved globals, but they're not in scope when the route module is executed).
Workaround: All server/api/** route files now have explicit import { ... } from 'h3' at the top.
this is a deliberate change in nitro
is this in the nuxt side or nitro side?