Skip to content

Commit 542b760

Browse files
authored
Add docs for uploading metafile to ESBuild Bundle Analyzer (#160)
1 parent 53ebf96 commit 542b760

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pages/cloudflare/troubleshooting.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ The Cloudflare Account you are deploying to is on the Workers Free plan, which [
1616

1717
When deploying your Worker, `wrangler` will show both the original and compressed sizes. Only the latter (gzipped size) matters for these limits.
1818

19+
### "Your Worker exceeded the size limit of 10 MiB"
20+
21+
If your Worker is larger than 10 MiB compressed — there might be unnecessary code ending up in your production bundle. You can visualize and understand this by running:
22+
23+
1. `npx opennextjs-cloudflare build` within your project's root directory
24+
2. `cd .open-next/server-functions/default` to open the directory that contains the bundled code
25+
3. Take the file named `handler.mjs.meta.json` and use the [ESBuild Bundle Analyzer](https://esbuild.github.io/analyze/) to visualize your application's code, and understand the largest parts of your production bundle
26+
1927
### My app fails to build when I import a specific NPM package
2028

2129
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)