test(build): pin the bundler flag to OMNIROUTE_USE_TURBOPACK, the contract it implements - #11583
Merged
diegosouzapw merged 2 commits intoAug 26, 2026
Conversation
…tract it implements
`Unit Tests fast-path` is red on every branch:
✖ resolveNextBuildBundlerFlag automatically disables Turbopack and uses Webpack under Bun
actual: '--turbopack', expected: '--webpack'
The test asserts a Bun-specific override that `resolveNextBuildBundlerFlag` does not
implement — it never reads `process.versions.bun` — including that an explicit
`OMNIROUTE_USE_TURBOPACK=1` is ignored under Bun. That contradicts the documented
contract: `docs/reference/ENVIRONMENT.md` describes the variable as the operator's
control, defaulting to Turbopack, with `0` as the escape hatch for Windows /
native-binding trouble / RAM-constrained machines (diegosouzapw#6409). Every webpack fallback in CI
is memory-motivated (nightly-compat pins `0` for a Node 26 OOM), none is Bun-motivated,
and nothing in the repo runs `next build` under Bun at all.
Rewrites the case to pin what the function implements, across bun-absent / 1.1.20 /
1.3.14 and all three env states, so a hidden runtime-sniffing override cannot come back
without failing here — and the failure names the runtime it fired on. The stale
assertion could not have done that: it demanded the very override this now forbids.
The function's comment said "Turbopack is the default (on Node.js and Bun 1.4+)", which
is what made the old assertion look load-bearing. Nothing implements that version gate,
so the comment now states the env-only rule and why it is env-only.
diegosouzapw
merged commit Aug 26, 2026
0a79221
into
diegosouzapw:release/v3.8.51
10 of 16 checks passed
diegosouzapw
pushed a commit
that referenced
this pull request
Aug 26, 2026
Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — #11580/#11582/#11583/#11585/#11588/#11589/#11590/#11591/#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
4 of 5 tasks
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…tract it implements (diegosouzapw#11583) Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…osouzapw#11608) Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — diegosouzapw#11580/diegosouzapw#11582/diegosouzapw#11583/diegosouzapw#11585/diegosouzapw#11588/diegosouzapw#11589/diegosouzapw#11590/diegosouzapw#11591/diegosouzapw#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The red test
Unit Tests fast-pathfails on every branch:Why I concluded the test is the stale side
I want to be explicit about this, because "align the assertion to current behaviour" is
exactly how a real defect gets buried, and I nearly left this one alone. The evidence:
resolveNextBuildBundlerFlagdoes notread
process.versions.bun— there is no runtime branch to have regressed. As far asthe (squashed) history goes back, there never was one.
docs/reference/ENVIRONMENT.mddescribesOMNIROUTE_USE_TURBOPACKas defaulting to1, with0the escape hatch "on Windows, when running into native binding /bundler-compat incompatibilities, or on RAM-constrained machines". No Bun clause.
nightly-compat.ymlpins0with a long comment about a Node 26 OOM kill on therunner;
electron-release.ymlpins0for the linux matrix leg.build.yml,ci.ymlandquality.ymlall pin1.bunappears only incheck:known-symbolsandtest:bun:db. There is nonext buildpath that runs on it.OMNIROUTE_USE_TURBOPACK=1be ignored under Bun. That directly contradicts thevariable being the operator's control — and CI is an operator that sets it to
1.If I have this backwards — if Turbopack genuinely cannot build under Bun < 1.4 —
then the fix belongs in
resolveNextBuildBundlerFlagas a version gate, not in thetest, and I will happily rewrite this PR that way. Say the word. What I did not want to
do is leave the gate red on a contradiction nobody had adjudicated.
What this PR does
Rewrites the case to pin the contract the function actually implements, and to keep a
real guard rather than just going green:
Three runtimes × three env states. A hidden runtime-sniffing override cannot come back
without failing here, and the assertion message names the runtime it fired on. The old
assertion could not have caught that — it demanded the override this now forbids.
The function's comment said "Turbopack is the default (on Node.js and Bun 1.4+)", which
is what made the stale assertion look load-bearing. Nothing implements that version
gate, so the comment now states the env-only rule and why it is env-only.
Verification
The new guard bites. I re-added a runtime override by hand
(
if (process.versions.bun) return "--webpack";above the env check):I deliberately left one pre-existing formatting deviation in
bun-support.test.tsuntouched (
prettierwants to expand thedummyBunDb.queryliteral) so the diff stayson the case being fixed.
No behaviour change: the only production edit is a comment.