Skip to content

fix(guards): use explicit .ts extensions to fix Node ESM resolution in app.config.ts#2600

Merged
mikib0 merged 2 commits into
developmentfrom
fix/app-config-guards-esm-resolution
Jun 18, 2026
Merged

fix(guards): use explicit .ts extensions to fix Node ESM resolution in app.config.ts#2600
mikib0 merged 2 commits into
developmentfrom
fix/app-config-guards-esm-resolution

Conversation

@mikib0

@mikib0 mikib0 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • packages/guards/src/index.ts re-exported internal modules with extensionless relative imports (./assertions, ./enum, etc.)
  • Node 25's native TypeScript support can load .ts files but does not auto-try .ts extensions for bare relative imports — ./assertions fails with ERR_MODULE_NOT_FOUND
  • This broke bun expo / expo start because app.config.ts imports isString from @packrat/guards, and Expo evaluates configs via Node's ESM loader

Changes

  • packages/guards/src/index.ts: changed to explicit .ts extensions (./assertions.ts, etc.) — Node 25 TypeScript support resolves these correctly
  • packages/guards/tsconfig.json: added allowImportingTsExtensions: true so tsc --noEmit accepts the .ts extension imports (valid since the package is source-only with noEmit: true in base config)
  • apps/expo/app.config.ts: restored original isString import (no change from intent — reverts the broken intermediate state)

Test plan

  • bun expo / cd apps/expo && bun start starts Metro without the ERR_MODULE_NOT_FOUND error
  • cd packages/guards && bun run check-types passes with no errors
  • Pre-push hooks pass (no-raw-typeof, circular deps, clean-checks)

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.
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@mikib0, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 624be487-fcd0-4ab5-8335-60085dc70f34

📥 Commits

Reviewing files that changed from the base of the PR and between b584a2b and 03fc995.

📒 Files selected for processing (3)
  • packages/guards/src/index.ts
  • packages/guards/tsconfig.json
  • tsconfig.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/app-config-guards-esm-resolution

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file api ci/cd mobile web database labels Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for apps/expo (./apps/expo)

Status Category Percentage Covered / Total
🔵 Lines 97.51% (🎯 95%) 589 / 604
🔵 Statements 97.51% (🎯 95%) 589 / 604
🔵 Functions 100% (🎯 97%) 51 / 51
🔵 Branches 95.3% (🎯 92%) 203 / 213
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/overpass (./packages/overpass)

Status Category Percentage Covered / Total
🔵 Lines 100% (🎯 80%) 155 / 155
🔵 Statements 100% (🎯 80%) 155 / 155
🔵 Functions 100% (🎯 80%) 13 / 13
🔵 Branches 95.65% (🎯 70%) 44 / 46
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/mcp (./packages/mcp)

Status Category Percentage Covered / Total
🔵 Lines 98.87% (🎯 95%) 176 / 178
🔵 Statements 98.87% (🎯 95%) 176 / 178
🔵 Functions 100% (🎯 95%) 13 / 13
🔵 Branches 98.38% (🎯 90%) 61 / 62
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/api (./packages/api)

Status Category Percentage Covered / Total
🔵 Lines 98.93% (🎯 95%) 1304 / 1318
🔵 Statements 98.93% (🎯 95%) 1304 / 1318
🔵 Functions 100% (🎯 97%) 71 / 71
🔵 Branches 95.64% (🎯 92%) 483 / 505
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/units (./packages/units)

Status Category Percentage Covered / Total
🔵 Lines 100% (🎯 100%) 35 / 35
🔵 Statements 100% (🎯 100%) 35 / 35
🔵 Functions 100% (🎯 100%) 6 / 6
🔵 Branches 100% (🎯 100%) 11 / 11
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/analytics (./packages/analytics)

Status Category Percentage Covered / Total
🔵 Lines 100% (🎯 80%) 744 / 744
🔵 Statements 100% (🎯 80%) 744 / 744
🔵 Functions 100% (🎯 85%) 48 / 48
🔵 Branches 87.35% (🎯 80%) 152 / 174
File CoverageNo changed files found.
Generated in workflow #325 for commit 03fc995 by the Vitest Coverage Report Action

@mikib0 mikib0 changed the base branch from main to development June 18, 2026 17:42
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.
@github-actions github-actions Bot removed documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file api ci/cd mobile web database labels Jun 18, 2026
@mikib0 mikib0 merged commit da8fa6d into development Jun 18, 2026
16 checks passed
@mikib0 mikib0 deleted the fix/app-config-guards-esm-resolution branch June 18, 2026 17:52
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.

1 participant