Cloudflare automatic deployment fails

I suddenly started receiving this build error. It works locally but fails if it is building on cloudflare.
No description
4 Replies
kapa.ai
kapa.ai2w ago
Hi @NightFuries. 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, there have been several recent issues with Nuxt deployments to Cloudflare Pages. The error you're experiencing is likely related to one of these known issues. Several users have reported similar problems with Cloudflare deployments in recent Nuxt versions. The most common errors include: 1. [unenv] process.getBuiltinModule is not implemented yet error with Nuxt 3.16.0 on Cloudflare Pages 2. Cannot access '_PerformanceObserver' before initialization error 3. Cannot access '_EventEmitter' before initialization error These issues appear to be related to conflicts between Nuxt's dependencies, particularly with the unenv package and how it interacts with Cloudflare's environment. Possible solutions: 1. Update to the latest Nitro version (2.11.6) which includes fixes for these issues:
npm install [email protected]

npm install [email protected]

or


2. Add Node compatibility configuration to your nuxt.config.ts:
defineNuxtConfig({
nitro: {
cloudflare: {
nodeCompat: true,
deployConfig: true,
}
}
})

defineNuxtConfig({
nitro: {
cloudflare: {
nodeCompat: true,
deployConfig: true,
}
}
})

Cloudflare Pages deployment issue 3. Temporarily downgrade Nitro to version 2.10.4 as a workaround:
npm install [email protected]

npm install [email protected]

or


4. If using Nuxt Content with Cloudflare Pages, ensure you're following the proper setup with D1 database as described in the Nuxt Content Cloudflare Pages deployment guide. These issues are actively being addressed by the Nuxt team, so updating to the latest versions of Nuxt and its dependencies is generally the best approach. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@711113525023735809> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
danielroe
danielroe2w ago
Make sure you update to v5 of nuxt-og-image.
NightFuries
NightFuriesOP2w ago
I would have to override that since that's not a direct dependency. Regardless, the issue was cloudflare uses npm install while I use bun. So npm doesn't read the bun lockfile and installed incompatible versions.. Cloudflare doesn't support bun so I'm having to use ci to upload it manually. Ehh, it works.

Did you find this page helpful?