Skip to content

Commit 68337d8

Browse files
authored
[cloudflare] added clarification on workers size limit (#114)
1 parent 5eb8515 commit 68337d8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pages/cloudflare/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,13 @@ The OpenNext Cloudflare adapter works by taking the Next.js build output and tra
6464
When you add [@opennextjs/cloudflare](https://www.npmjs.com/package/@opennextjs/cloudflare) as a dependency to your Next.js app, and then run `npx opennextjs-cloudflare` the adapter first builds your app by running the `build` script in your `package.json`, and then transforms the build output to a format that you can run locally using [Wrangler](https://developers.cloudflare.com/workers/wrangler/), and deploy to Cloudflare.
6565

6666
You can view the code for `@opennextjs/cloudflare` [here](https://github.com/opennextjs/opennextjs-cloudflare/blob/main/packages/cloudflare/src) to understand what it does under the hood.
67+
68+
### Note on Worker Size Limits
69+
70+
The size limit of a Cloudflare Worker is 3 MiB on the Workers Free plan, and 10 MiB on the Workers Paid plan. After building your Worker, `wrangler` will show both the original and compressed sizes:
71+
72+
```
73+
Total Upload: 13833.20 KiB / gzip: 2295.89 KiB
74+
```
75+
76+
Only the latter (compressed size) matters for [the Worker size limit](https://developers.cloudflare.com/workers/platform/limits/#worker-size).

pages/cloudflare/troubleshooting.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ If you need to deploy to Cloudflare Pages, you can use `@cloudflare/next-on-page
1414

1515
The Cloudflare Account you are deploying to is on the Workers Free plan, which [limits the size of each Worker to 3 MiB](https://developers.cloudflare.com/workers/platform/limits/#worker-size). When you subscribe to the Workers Paid plan, each Worker can be up to 10 MiB.
1616

17+
When deploying your Worker, `wrangler` will show both the original and compressed sizes. Only the latter (gzipped size) matters for these limits.
18+
1719
### My app fails to build when I import a specific NPM package
1820

1921
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/).

0 commit comments

Comments
 (0)