fix(build): unblock standalone production build (6 issues: catalog syntax, imports, wasm, migration) - #10108
fix(build): unblock standalone production build (6 issues: catalog syntax, imports, wasm, migration)#10108HouMinXi wants to merge 6 commits into
Conversation
diegosouzapw#9421 inserted naga-ac and chatanywhere after regolo's apiHint but never closed regolo first, so every following provider became a property of the open object and the file's closing brace stopped matching. The mismatch broke every TypeScript compile that loads the apikey provider catalog (tsc: "',' expected" at EOF), and any test importing it.
diegosouzapw#8974 added conol-web with a three-level `../` where the sibling registry entries (promptql, hyperagent, notion-web) use four; the same typo hit deepai's `../shared` which must be `../../shared.ts`. Both resolved to a missing module, breaking the Next.js production build.
Two upstream regressions broke next build module parsing:
- tinycmsSigner.ts: the new URL('wasm_signer_bg.wasm') fallback is dead
code (the wasm is embedded as a base64 constant and always passed to
init), but webpack statically resolves it and the .wasm is not committed.
webpackIgnore leaves the runtime URL alone.
- modelSelectModalHelpers.ts: isProviderModelHidden lost its closing brace,
so the following export was parsed inside the function body
("import/export cannot be used outside of module code").
Both verified via esbuild transform; runtime behavior unchanged.
bd12b9e to
6d31929
Compare
videoGeneration.ts imported handleFalVideoGeneration from both videoGeneration/falHandler.ts (line 21) and mediaGeneration/fal.ts (line 54). The two implementations have different signatures; the call site at line 216 uses the destructured-args form that matches falHandler.ts. The duplicate import caused webpack to fail with 'Identifier has already been declared'. Signed-off-by: Minxi Hou <houminxi@gmail.com>
143_job_registry.sql was an obsolete copy of 146_job_registry.sql (its comment still read 'Migration 139'). Both created identical jobs + job_runs tables, causing 'Migration version collision: version=143 → [api_key_cache_default_mode, job_registry]' on startup. The X500 live DB already has 143 = api_key_cache_default_mode, so the correct numbering is 146 for job_registry. Deleted the duplicate. Signed-off-by: Minxi Hou <houminxi@gmail.com>
conolDiscovery.ts imported getProviderOutboundGuard from @/shared/network/outboundUrlGuard, but the function lives in outboundUrlGuardPolicy. webpack compiles the missing export as undefined, so a request to the provider model discovery route would throw at runtime. Signed-off-by: Minxi Hou <houminxi@gmail.com>
|
Heads-up: the six build breakages this fixes were independently resolved by #10198 (build/lint/SWR repair) and #10131 (base-reds round 2), both merged into |
|
Thanks for the build-unblocking work. Checking against the current Since there is no real delta left to ship, I'm closing this in favor of the already-merged fixes. If a specific standalone-build blocker remains, please open a fresh PR against the current |
|
Closing as subsumed — all 6 fixes already landed in the base (see the comment above for the per-fix evidence). |
Problem: the production
npm run build(Next.js 16 standalone) fails at six independent points, so no deploy image can be produced fromrelease/v3.8.50:Gateways catalog syntax —
#9421insertednaga-ac/chatanywhereright afterregolo'sapiHintvalue without closing theregoloobject first. Every following provider became a property of the still-open object and the file's closing brace no longer matched the openingexport const APIKEY_PROVIDERS_GATEWAYS = {.tscfails at EOF (',' expectedatgateways.ts:1213) for any module importing the apikey provider catalog.Registry import paths —
conol-web/index.tsanddeepai/index.tsimport their shared modules with too few../levels (../../../services/instead of../../../../services/,../sharedinstead of../../shared.ts). Both failedmodule not foundat build time; the sibling entries in the same directory use the corrected depths.Standalone build blockers —
tinycmsSigner.tsstatically resolveswasm_signer_bg.wasmvianew URL(..., import.meta.url), which webpack treats as a bundle asset and fails when the file is absent; the WASM is already inlined as base64, so the URL is never exercised — a/* webpackIgnore: true */tells webpack to leave it alone.modelSelectModalHelpers.tswas missing the closing brace ofisProviderModelHidden(), so the module would not parse.Duplicate import (webpack fatal) —
videoGeneration.tsimportshandleFalVideoGenerationfrom bothvideoGeneration/falHandler.ts(line 21) andmediaGeneration/fal.ts(line 54). The two implementations have different signatures; the call site uses the destructured-args form that matchesfalHandler.ts. Webpack fails withIdentifier 'handleFalVideoGeneration' has already been declared.Migration version collision (startup fatal) —
143_job_registry.sqlcollides with143_api_key_cache_default_mode.sql; the runner refuses to boot withMigration version collision: version=143 → [api_key_cache_default_mode, job_registry]. The file is an obsolete copy of146_job_registry.sql(its comment still reads "Migration 139", the SQL is identical), and deployed DBs already hold143 = api_key_cache_default_mode.Wrong import path (runtime crash) —
conolDiscovery.tsimportsgetProviderOutboundGuardfrom@/shared/network/outboundUrlGuard, but the function lives inoutboundUrlGuardPolicy. Webpack compiles the missing export asundefined, so a request to the provider model discovery route throws at runtime.Fixes:
gateways.ts: add the missing},closingregolo(1 line).conol-web/index.ts,deepai/index.ts: correct the import depths to match the sibling entries (2 lines).tinycmsSigner.ts:/* webpackIgnore: true */on the wasmnew URL(1 line).modelSelectModalHelpers.ts: restore the closing}ofisProviderModelHidden(1 line).videoGeneration.ts: remove the duplicatemediaGeneration/fal.tsimport (1 line).143_job_registry.sql(48 lines);146_job_registry.sqlcarries the table definitions.conolDiscovery.ts: point the import atoutboundUrlGuardPolicy(1 line).Verification: a full standalone production build (
--target runner-base, webpack path, 8 GB heap, 16 GB container) completes with the standalone integrity check passing for@atjsh/llmlingua-2,@huggingface/transformers,@tensorflow/tfjs,js-tiktoken, andonnxruntime-node. The resulting image boots healthy on the production server with migrations 143/146/147/150 applied cleanly, andnpm run lintexits 0.