Deploy Nuxt Content to Cloudflare Pages
Hey all!
I have a really hard time to deploy an instance of Nuxt Content to Cloudflare Page. The deployment goes well up to the point where it errors when deploying to Cloudflare Global Network:
I really could use some help here if possible.
Thank you!
4 Replies
Hi @ParadoxLector. 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 information provided in the knowledge sources, I can offer some guidance on deploying Nuxt Content to Cloudflare Pages.
The error you're encountering suggests there might be an issue with the compatibility between your Nuxt Content setup and Cloudflare Pages. Here are some steps you can try to resolve this:
1. Use the correct preset: Make sure you're using the
cloudflare_pages
preset when building your app. You can do this by adding the following to your nuxt.config.ts
file:
Alternatively, you can use the --preset
option when building:
2. Set up a D1 database: Nuxt Content requires a D1 database to be connected to the app when deploying to Cloudflare Pages. Create a new D1 database in your Cloudflare dashboard and connect it to your project using the binding name DB
(which is the default name used by the module).
3. Check your database configuration: If you're using a custom database configuration, make sure it's correctly set up in your nuxt.config.ts
file.
4. Verify compatibility: Ensure that all the modules and libraries you're using are compatible with Cloudflare Pages, which runs on edge functions. Some Node.js-specific libraries might not work in this environment.
5. Update to the latest versions: Make sure you're using the latest versions of Nuxt, Nuxt Content, and other related packages, as newer versions might have fixes for Cloudflare Pages deployment issues.
If you're still encountering issues after trying these steps, you might want to check the Nuxt Content documentation for Cloudflare Pages deployment for any additional troubleshooting steps or known issues.
Remember that deploying to Cloudflare Pages with Nuxt Content is supported, but it requires some specific configuration. If you continue to face problems, you might want to create a minimal reproduction of your issue and seek help from the Nuxt community or Cloudflare support.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@446488252854304776> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
A D1 database (which is empty) is already setup and connected to the app. The preset for nitro is setup to "cloudflare_pages".

It appears the culprit is "nuxt-mail" module. After disable it, the deployment is 100% correct.