Skip to content

Conversation

@SolidKalium
Copy link
Contributor

Emphasize the necessity of creating a D1 database and how to configure wrangler so nuxi preview works.

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Changes

  • Places more emphasis on a D1 database being required
  • Provides a minimal example wrangler config for running preview locally
  • Explains what this example config does
  • Links to Nuxt Content's docs section for D1 configuration
  • Links more directly to Cloudflare's documentation about creating and binding a D1 database

Why

My initial reading of the statement that the module will "prepare the necessary configuration" caused me to misunderstand the importance of D1 being required. I think the new emphasis should help prevent that misreading.

I also had trouble running nuxi preview locally to check a mismatch between local and prod behavior. I no longer recall if nuxi preview actually helped me solve my problems, but I suspect other people probably don't want to be stuck configuring preview when they think it will help debugging something else.

For context, the issues I was debugging (and have since resolved) were:

  • Some content not loading correctly. This was likely because another source told me to use generate instead of build, and I then also didn't have D1 set up.
  • An infinite 404 loop. This was likely caused by the fact that I didn't have an error.vue file and the fact that my default slug was throwing a 404 when content was missing. But local dev was ok because it provides an error page.
  • A file I created postbuild wasn't being added to _routes, because _routes is created during build and I didn't understand that part of Cloudflare enough to expect the issue.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Emphasize the necessity of creating a D1 database and how to configure wrangler so `nuxi preview` works.
@vercel
Copy link

vercel bot commented Oct 27, 2025

@SolidKalium is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 27, 2025

npm i https://pkg.pr.new/@nuxt/content@3587

commit: 8aa82f9

Copy link
Member

@atinux atinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update spacing

@atinux
Copy link
Member

atinux commented Oct 27, 2025

Thank you for your help, would you be happy to also update the Cloudflare Workers page @SolidKalium ?

@SolidKalium
Copy link
Contributor Author

I haven't built for that target directly and don't have a plan to. So I don't think I'd be a good author for that. But feel free to copy over any relevant content I added.

Co-authored-by: Sébastien Chopin <[email protected]>
@farnabaz farnabaz merged commit b6aba9c into nuxt:main Nov 26, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants