diff --git a/packages/wrangler/src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts b/packages/wrangler/src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts index 82b5703725a0..2d584d285912 100644 --- a/packages/wrangler/src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts +++ b/packages/wrangler/src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts @@ -19,7 +19,9 @@ export const cloudflareInternalPlugin: Plugin = { // imports of external modules such as `cloudflare:...`, // which won't be inlined/bundled by esbuild, are invalid. const pathList = new Intl.ListFormat("en-US").format( - Array.from(paths.keys()).map((p) => `"${p}"`) + Array.from(paths.keys()) + .map((p) => `"${p}"`) + .sort() ); throw new Error( dedent` diff --git a/packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts b/packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts index 51af155293ed..ed3c02b17fa7 100644 --- a/packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts +++ b/packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts @@ -38,7 +38,9 @@ function errorOnServiceWorkerFormat(build: PluginBuild) { build.onEnd(() => { if (build.initialOptions.format === "iife" && paths.size > 0) { const pathList = new Intl.ListFormat("en-US").format( - Array.from(paths.keys()).map((p) => `"${p}"`) + Array.from(paths.keys()) + .map((p) => `"${p}"`) + .sort() ); throw new Error( dedent` diff --git a/packages/wrangler/src/deployment-bundle/esbuild-plugins/nodejs-compat.ts b/packages/wrangler/src/deployment-bundle/esbuild-plugins/nodejs-compat.ts index 6d57de18332b..934de4611317 100644 --- a/packages/wrangler/src/deployment-bundle/esbuild-plugins/nodejs-compat.ts +++ b/packages/wrangler/src/deployment-bundle/esbuild-plugins/nodejs-compat.ts @@ -67,7 +67,9 @@ export const nodejsCompatPlugin: (silenceWarnings: boolean) => Plugin = ( warnedPackaged.size > 0 ) { const paths = new Intl.ListFormat("en-US").format( - Array.from(warnedPackaged.keys()).map((p) => `"${p}"`) + Array.from(warnedPackaged.keys()) + .map((p) => `"${p}"`) + .sort() ); throw new Error(` Unexpected external import of ${paths}. Imports are not valid in a Service Worker format Worker.