Skip to content

Commit 41fe4af

Browse files
committed
fix: support Next 14 experimental.serverExternalPackages
1 parent 9ed8d8a commit 41fe4af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cloudflare/src/cli/build/utils/workerd.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ export async function copyWorkerdPackages(options: BuildOptions, nodePackages: M
8181

8282
// Copy full external packages when they use "workerd" build condition
8383
const nextConfig = loadConfig(path.join(options.appBuildOutputPath, ".next"));
84-
const externalPackages = nextConfig.serverExternalPackages ?? [];
84+
const externalPackages =
85+
// @ts-expect-error In Next 14 its under experimental
86+
nextConfig.serverExternalPackages ?? nextConfig.experimental.serverExternalPackages ?? [];
8587
for (const [src, dst] of nodePackages.entries()) {
8688
try {
8789
const pkgJson = JSON.parse(await fs.readFile(path.join(src, "package.json"), "utf8"));

0 commit comments

Comments
 (0)