[AIG-922] Fix on-prem Docker build: optional @xenova import no longer breaks tsc (TS2307) - #56
Conversation
…c/Docker build doesn't fail when absent
|
Warning Review limit reached
More reviews will be available in 6 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes the
coveragejob onmain(flaky-red, pre-existing): the on-premdocker build(tests/integration/docker-helm.test.ts, AIG-647) failed because@xenova/transformers— an optionalDependency (vector-WASM, AIG-653) with heavy native deps — fails to install in the slim image, sotschitTS2307 Cannot find moduleon the literal dynamic import atsrc/memory/embedding/wasm/model-loader.ts:54.Change (1 file, 1 import)
Hold the specifier in a variable so
tscdoes not statically resolve the optional module:Runtime behaviour is unchanged — Node resolves the specifier at runtime and the surrounding try/catch already returns
nullwhen the dep is absent.Why this is not a regression from the recent merges
The
coveragejob is main-only (if: push && ref==main) and was already intermittently red before this session (e.g. main runsde30879/1aa93eagreen,19f44b3/7d9ec93red).docker-helm.test.ts(AIG-647) and the@xenovaimport (AIG-653) pre-date AIG-852/854/855/866/867.Validation note
No PR job reproduces the "@xenova absent" condition (PR
Buildruns on ubuntu where the optional dep installs). The fix is validated by the post-mergecoveragerun on main (which runs the real docker build).Closes AIG-922.