Skip to content

Commit

Permalink
fix not-deterministic log message (#6885)
Browse files Browse the repository at this point in the history
path list ordering
  • Loading branch information
RamIdeas authored Oct 4, 2024
1 parent f16f961 commit 1d1a04d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1d1a04d

Please sign in to comment.