Fix OMNIROUTE_BUILD_PROFILE=minimal: complete stub exports, fix webpack path resolution - #12810
Merged
diegosouzapw merged 5 commits intoSep 29, 2026
Conversation
…ck path resolution Two independent bugs prevented a working minimal build: 1. Stub modules (ninerouter, mitm/cert/install) were missing named exports that real routes actually import (getInstalledVersion, getLatestVersion, update, uninstall, installCertResult), and one had the wrong function name (installNinerouter instead of install). Under Turbopack's resolveAlias this produced 9 'Export X doesn't exist in target module' compile errors -- the minimal profile could not build via Turbopack at all. 2. Under webpack, NormalModuleReplacementPlugin set resource.request to a relative path ('./src/lib/cloudSync.stub.ts'), which resolves against the importing file's directory, not the project root -- only worked for imports literally at the project root. Fixed using the projectRoot helper next.config.mjs already defines for other purposes. Both verified with full, real builds (docker build --target runner-base --build-arg OMNIROUTE_BUILD_PROFILE=minimal, both with and without OMNIROUTE_USE_TURBOPACK=0) -- confirmed the real privileged-code identifiers are absent from the compiled output and FeatureDisabledError is correctly wired into the real route handlers. Fixes diegosouzapw#12806, Fixes diegosouzapw#12807
Owner
|
Verified both root causes: #12806 and #12807 are indeed still open, and I confirmed on the |
…2806, diegosouzapw#12807) Add a regression test asserting the OMNIROUTE_BUILD_PROFILE=minimal stubs (ninerouter, mitm/cert/install) export every name real consumer routes import from the aliased module. Without this fix, missing exports only surfaced as a Turbopack "Export X doesn't exist in target module" error during a full docker build; the test statically parses real consumer imports and confirms the stub covers them, so the next export drift between a real module and its stub fails fast instead of silently breaking the minimal build again. Also adds the changelog.d fragment. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
The PR's own export-parity test caught it: src/mitm/manager.ts and the agent-bridge server route import installCaCert (diegosouzapw#6684) from @/mitm/cert/install, which the minimal-profile stub did not export.
diegosouzapw
merged commit Sep 29, 2026
29606e2
into
diegosouzapw:release/v3.8.51
2 of 3 checks passed
diegosouzapw
added a commit
that referenced
this pull request
Sep 29, 2026
… 4) (#15109) Release-captain base-red fix (v3.8.51 release PR #11442, unit shards 3-4): one production defect (proxyLogger pulled into every settings→proxies import and queried the DB at import time; helper extracted to src/lib/proxyLogHost.ts) and seven contract propagations from #14732, #15044, #15067, #13548, #14117×#14844, #12810. 74/74 across the seven files, 176/176 proxy-log neighbours, typecheck clean.
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.
Fixes both bugs reported in #12806 and #12807.
#12806 -- stub modules (
ninerouter,mitm/cert/install) were missing named exports real routes import (getInstalledVersion,getLatestVersion,update,uninstall,installCertResult), and one had the wrong function name (installNinerouterinstead ofinstall). Fixed to match the real modules' exact names/signatures -- every stub still only throwsFeatureDisabledError, no privileged functionality restored.#12807 --
NormalModuleReplacementPlugin'sresource.requestused a relative path that only resolved from the project root. Fixed using theprojectRoothelpernext.config.mjsalready defines for other purposes.Verified with full, real builds (
docker build --target runner-base --build-arg OMNIROUTE_BUILD_PROFILE=minimal, both with and withoutOMNIROUTE_USE_TURBOPACK=0) -- confirmed the real privileged-code identifiers are absent from the compiled server output andFeatureDisabledErroris correctly wired into the real route handlers, not just that the build succeeds.