-
-
Couldn't load subscription status.
- Fork 725
docs: Clarify Cloudflare Pages and D1 #3587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Emphasize the necessity of creating a D1 database and how to configure wrangler so `nuxi preview` works.
|
@SolidKalium is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update spacing
| ### Local Preview | ||
| While `nuxi dev` and `nuxi build` don't require any extra configuration, testing a build locally with `nuxi preview` requires Cloudflare's Wrangler to be configured to provide a temporary, local database for Nuxt Content to bind. This can be done with a `wrangler.jsonc` or `wrangler.toml` file. Because Wrangler creates a local database, `database_name` and `database_id` can safely, but don't need to, match the values in production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Local Preview | |
| While `nuxi dev` and `nuxi build` don't require any extra configuration, testing a build locally with `nuxi preview` requires Cloudflare's Wrangler to be configured to provide a temporary, local database for Nuxt Content to bind. This can be done with a `wrangler.jsonc` or `wrangler.toml` file. Because Wrangler creates a local database, `database_name` and `database_id` can safely, but don't need to, match the values in production. | |
| ### Local Preview | |
| While `nuxi dev` and `nuxi build` don't require any extra configuration, testing a build locally with `nuxi preview` requires Cloudflare's Wrangler to be configured to provide a temporary, local database for Nuxt Content to bind. This can be done with a `wrangler.jsonc` or `wrangler.toml` file. Because Wrangler creates a local database, `database_name` and `database_id` can safely, but don't need to, match the values in production. |
|
|
||
| - [Nuxt Deploy documentation](https://nuxt.com/deploy/cloudflare) | ||
| - [Cloudflare D1 documentation](https://developers.cloudflare.com/d1/) | ||
| - [Create and bind a D1 database](https://developers.cloudflare.com/d1/get-started/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - [Create and bind a D1 database](https://developers.cloudflare.com/d1/get-started/) | |
| - [Create and bind a D1 database](https://developers.cloudflare.com/d1/get-started/) |
| ## D1 Database | ||
| A D1 database connected to the app is **required** for the Nuxt Content module to work. By default the module uses the binding name **`DB`**. You can override the [database configuration](/docs/getting-started/configuration#d1) by providing your own in `nuxt.config.ts`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## D1 Database | |
| A D1 database connected to the app is **required** for the Nuxt Content module to work. By default the module uses the binding name **`DB`**. You can override the [database configuration](/docs/getting-started/configuration#d1) by providing your own in `nuxt.config.ts`. | |
| ## D1 Database | |
| A D1 database connected to the app is **required** for the Nuxt Content module to work. By default the module uses the binding name **`DB`**. You can override the [database configuration](/docs/getting-started/configuration#d1) by providing your own in `nuxt.config.ts`. |
|
Thank you for your help, would you be happy to also update the Cloudflare Workers page @SolidKalium ? |
|
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. |
Emphasize the necessity of creating a D1 database and how to configure wrangler so
nuxi previewworks.π Linked issue
β Type of change
π Description
Changes
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 previewlocally to check a mismatch between local and prod behavior. I no longer recall ifnuxi previewactually 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:
π Checklist