Debugging
Learn how to debug your Nuxt application which cannot start on Cloudflare Workers / Pages.
Some Nuxt modules or librairies you use in your project may not be compatible with the edge runtime yet. When this happens, your Nuxt server cannot even start in production, producing a 500 error.
The current solution to debug is the following.
- Disable Nitro minification in your
nuxt.config.ts
nuxt.config.ts
export default defineNuxtConfig({
nitro: {
minify: false
}
})
- Build your application for production with the Cloudflare Pages preset
Terminal
npx nuxt build --preset cloudflare-pages
- Preview the production server in the Worker environment
Terminal
npx wrangler pages dev dist/
As we don't support generating the
wrangler.toml
so far, you may expect some 500 errors when accessing the database, kv, cache or blob.- Open the browser by pressing the b shortut (most of the time it starts on http://localhost:8788)
- Go back to your terminal and look at the error and stack trace, then open the file (should be in the
dist/
directory) to know the line causing the error.
Most of the time, you will need to find scroll above to know what library is causing the error.
- Open an issue in our repository so we can help making more librairies Edge compatible.