Skip to content

Commit

Permalink
fix(next-swc): correctly set wasm fallback for known target triples (#…
Browse files Browse the repository at this point in the history
…64567)

### What

Fixes a regression to enable wasm fallback for the know target triples
(that does not have native bindings). The condition was skewed when
introducing `useWasmBinary` flag.

Closes PACK-2969
  • Loading branch information
kwonoj authored Apr 16, 2024
1 parent ce69d02 commit cc4f7f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/build/swc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ export async function loadBindings(
!!triple?.raw && knownDefaultWasmFallbackTriples.includes(triple.raw)
)
const isWebContainer = process.versions.webcontainer
// Normal execution relies on the param `useWasmBinary` flag to load, but
// in certain cases where there isn't a native binary we always load wasm fallback first.
const shouldLoadWasmFallbackFirst =
(!disableWasmFallback && unsupportedPlatform && useWasmBinary) ||
(!disableWasmFallback && useWasmBinary) ||
unsupportedPlatform ||
isWebContainer

if (!unsupportedPlatform && useWasmBinary) {
Expand Down

0 comments on commit cc4f7f2

Please sign in to comment.