fix(guards): use explicit .ts extensions to fix Node ESM resolution in app.config.ts#2600
Conversation
app.config.ts is loaded by Node 25's native TypeScript support at Expo startup. Node's ESM resolver does not auto-try .ts extensions for bare relative imports (./assertions), causing ERR_MODULE_NOT_FOUND when @packrat/guards is imported from app.config.ts. Fix: use explicit .ts extensions in packages/guards/src/index.ts. Node 25+ TypeScript support resolves .ts extension imports correctly. Enable allowImportingTsExtensions in the guards tsconfig to satisfy tsc (valid since the package is source-only with noEmit: true). Restores the isString import in app.config.ts to keep the no-raw-typeof pre-push lint passing.
|
Warning Review limit reached
More reviews will be available in 19 minutes and 57 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
Coverage Report for apps/expo (./apps/expo)
File CoverageNo changed files found. |
Coverage Report for packages/overpass (./packages/overpass)
File CoverageNo changed files found. |
Coverage Report for packages/mcp (./packages/mcp)
File CoverageNo changed files found. |
Coverage Report for packages/api (./packages/api)
File CoverageNo changed files found. |
Coverage Report for packages/units (./packages/units)
File CoverageNo changed files found. |
Coverage Report for packages/analytics (./packages/analytics)
File CoverageNo changed files found. |
The root tsc pass (bun check-types) includes packages/guards/src and now sees the .ts extension imports added in the guards fix. Add allowImportingTsExtensions at the root level so the monorepo-wide type check accepts them. Valid because the root tsconfig already has noEmit: true.
Summary
packages/guards/src/index.tsre-exported internal modules with extensionless relative imports (./assertions,./enum, etc.).tsfiles but does not auto-try.tsextensions for bare relative imports —./assertionsfails withERR_MODULE_NOT_FOUNDbun expo/expo startbecauseapp.config.tsimportsisStringfrom@packrat/guards, and Expo evaluates configs via Node's ESM loaderChanges
packages/guards/src/index.ts: changed to explicit.tsextensions (./assertions.ts, etc.) — Node 25 TypeScript support resolves these correctlypackages/guards/tsconfig.json: addedallowImportingTsExtensions: truesotsc --noEmitaccepts the.tsextension imports (valid since the package is source-only withnoEmit: truein base config)apps/expo/app.config.ts: restored originalisStringimport (no change from intent — reverts the broken intermediate state)Test plan
bun expo/cd apps/expo && bun startstarts Metro without theERR_MODULE_NOT_FOUNDerrorcd packages/guards && bun run check-typespasses with no errorsno-raw-typeof, circular deps, clean-checks)