Skip to content

Fix OMNIROUTE_BUILD_PROFILE=minimal: complete stub exports, fix webpack path resolution - #12810

Merged
diegosouzapw merged 5 commits into
diegosouzapw:release/v3.8.51from
alpha-code2019:fix/minimal-build-profile-stub-exports
Sep 29, 2026
Merged

diegosouzapw merged 5 commits into
diegosouzapw:release/v3.8.51from
alpha-code2019:fix/minimal-build-profile-stub-exports

Conversation

@alpha-code2019

Copy link
Copy Markdown
Contributor

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 (installNinerouter instead of install). Fixed to match the real modules' exact names/signatures -- every stub still only throws FeatureDisabledError, no privileged functionality restored.

#12807 -- NormalModuleReplacementPlugin's resource.request used a relative path that only resolved from the project root. Fixed using the projectRoot helper next.config.mjs already defines for other purposes.

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 server output and FeatureDisabledError is correctly wired into the real route handlers, not just that the build succeeds.

…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
@diegosouzapw

Copy link
Copy Markdown
Owner

Verified both root causes: #12806 and #12807 are indeed still open, and I confirmed on the
current tip that the stub exports and the relative resource.request path are exactly as
broken as described — your new export names/signatures match the real modules exactly. This
looks solid; the one gap is an automated regression test (you validated with real
docker build runs, which is great, but a unit test asserting export parity between stub and
real module would keep this from silently drifting again). Please add that, rebase onto
release/v3.8.51, and this should be close to merge-ready.

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.51 September 15, 2026 11:37
alpha-code2019 and others added 4 commits September 15, 2026 18:56
…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
diegosouzapw merged commit 29606e2 into diegosouzapw:release/v3.8.51 Sep 29, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants