Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pages/cloudflare/bindings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Callout } from 'nextra/components';

#### How to configure your Next.js app so it can access bindings

Install [@opennextjs/cloudflare](https://www.npmjs.com/package/@opennextjs/cloudflare), and then add a `wrangler.toml` file in the root directory of your Next.js app, as described in [Get Started](/cloudflare/get-started).
Install [@opennextjs/cloudflare](https://www.npmjs.com/package/@opennextjs/cloudflare), and then add a [wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/) in the root directory of your Next.js app, as described in [Get Started](/cloudflare/get-started#3-create-a-wranglerjson-file).

#### How to access bindings in your Next.js app

Expand All @@ -29,7 +29,7 @@ export async function GET(request) {

#### How to add bindings to your Worker

Add bindings to your Worker by [adding them to your `wrangler.toml` configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/).
Add bindings to your Worker by adding them to your [wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/).

## TypeScript type declarations for bindings

Expand Down
6 changes: 3 additions & 3 deletions pages/cloudflare/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ npm install --save-dev wrangler@latest
You must use Wrangler version `3.99.0` or later to deploy Next.js apps using `@opennextjs/cloudflare`.
</Callout>

##### 3. Create a `wrangler.json` file
##### 3. Create a wrangler configuration file

<Callout type='info'>
This step is optional since `@opennextjs/cloudflare` creates this file for you during the build process (if not already present).
</Callout>

A [`wrangler.json`](https://developers.cloudflare.com/workers/wrangler/configuration/) file is needed for your
A [wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/) is needed for your
application to be previewed and deployed, it is also where you configure your Worker and define what resources it can access via [bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings).

You can create one yourself with the following content:
You can create one yourself in the root directory of your Next.js app with the name `wrangler.json` and the following content:
```jsonc
{
"main": ".open-next/worker.js",
Expand Down
3 changes: 2 additions & 1 deletion pages/cloudflare/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ The Cloudflare Account you are deploying to is on the Workers Free plan, which [

### My app fails to build when I import a specific NPM package

First, make sure that the `nodejs_compat` compatibility flag is enabled, and your compatibility date is set to on or after "2024-09-23", in your `wrangler.toml` file. [Refer to the Workers docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/) for more details on Node.js support in Cloudflare Workers.
First, make sure that the `nodejs_compat` compatibility flag is enabled, and your compatibility date is set to on or after "2024-09-23", in your [wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/).
Refer to the [Node.js Workers docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/) for more details on Node.js support in Cloudflare Workers.

Some NPM packages define multiple exports. For example:

Expand Down
Loading