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
1 change: 1 addition & 0 deletions packages/open-next/src/build/createMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export async function createMiddleware(
outfile: path.join(options.buildDir, "middleware.mjs"),
middlewareInfo: edgeMiddlewareInfo,
options,
overrides: config.default.override,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed here ?
It should use the default override provided by the default function itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that cause any issue?
It's here so that the other change in this PR can see the cloudflare wrapper

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho right, it should be a no-op in this case

onlyBuildOnce: true,
name: "middleware",
});
Expand Down
4 changes: 3 additions & 1 deletion packages/open-next/src/build/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ export async function isEdgeRuntime(
return false;
}
if (typeof overrides.wrapper === "string") {
return ["cloudflare-edge", "cloudflare"].includes(overrides.wrapper);
return ["cloudflare-edge", "cloudflare", "cloudflare-node"].includes(
overrides.wrapper,
);
}
return (await overrides?.wrapper?.())?.edgeRuntime;
}
Expand Down