Skip to content

Commit 26bc5bb

Browse files
add hack to get standard build to work
1 parent 059fd88 commit 26bc5bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cloudflare/src/api/get-cloudflare-context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ async function getCloudflareContextInNextDev<
6969
};
7070

7171
if (!global[cloudflareContextInNextDevSymbol]) {
72-
// Note: we need to add the webpackIgnore comment to the dynamic import because
73-
// the next dev server transpiled modules on the fly but we don't want it to try
74-
// to also transpile the wrangler code
75-
const { getPlatformProxy } = await import(/* webpackIgnore: true */ "wrangler");
72+
// Note: we never want wrangler to be bundled in the Next.js app, that's why the import below looks like it does
73+
const { getPlatformProxy } = await import(
74+
/* webpackIgnore: true */ `${"__wrangler".replaceAll("_", "")}`
75+
);
7676
const { env, cf, ctx } = await getPlatformProxy();
7777
global[cloudflareContextInNextDevSymbol] = {
7878
env,

0 commit comments

Comments
 (0)