Skip to content

Commit a00a124

Browse files
veggiedefenderJesse Li
andauthored
Increase maxBuffer for capnp upload (#10233)
Co-authored-by: Jesse Li <[email protected]>
1 parent 77a4364 commit a00a124

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.changeset/fifty-tires-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Increase the maxBuffer size for capnp uploads

packages/wrangler/src/deployment-bundle/capnp.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ export function handleUnsafeCapnp(capnp: CfCapnp): Buffer {
2020
);
2121
}
2222
const srcPrefix = resolve(base_path ?? ".");
23-
const capnpProcess = spawnSync("capnp", [
24-
"compile",
25-
"-o-",
26-
`--src-prefix=${srcPrefix}`,
27-
...capnpSchemas,
28-
]);
23+
const capnpProcess = spawnSync(
24+
"capnp",
25+
["compile", "-o-", `--src-prefix=${srcPrefix}`, ...capnpSchemas],
26+
// This number was chosen arbitrarily. If you get ENOBUFS because your compiled schema is still
27+
// too large, then we may need to bump this again or figure out another approach.
28+
// https://github.com/cloudflare/workers-sdk/pull/10217
29+
{ maxBuffer: 3 * 1024 * 1024 }
30+
);
2931
if (capnpProcess.error) {
3032
throw capnpProcess.error;
3133
}

0 commit comments

Comments
 (0)