Skip to content

Fix/mobile tsconfig path aliases - #586

Merged
Miracle656 merged 4 commits into
Miracle656:mainfrom
Davoski1:fix/mobile-tsconfig-path-aliases
Sep 3, 2026
Merged

Miracle656 merged 4 commits into
Miracle656:mainfrom
Davoski1:fix/mobile-tsconfig-path-aliases

Conversation

@Davoski1

Copy link
Copy Markdown
Contributor

Summary

Configure the mobile TypeScript project to use the same @/ path alias as the web wallet by mapping "@/*": ["./*"]. This makes imports consistent across mobile and web and prevents import/type errors when moving code between the apps.

Changes

  • Update frontend/mobile/tsconfig.json:
    • Change "@/*" path mapping from ["./app/*"] to ["./*"].
    • Preserve existing "@/assets/*": ["./assets/*"] mapping.

Why

The web wallet uses "@/*": ["./*"], but the mobile app previously mapped @/* only to ./app/*. That made many @/... imports resolve differently on mobile vs web, causing type and resolution issues. Unifying the alias improves developer ergonomics and CI consistency.

Testing / Verification

  • Run tsc --noEmit in the frontend/mobile workspace (or rely on CI) to verify no resolution/type errors.
  • Build a development Expo run to ensure Metro/Babel resolves the alias as expected (Expo automatically respects path mappings when using a compatible Metro config or plugin).
    Closes 9. tsconfig + path aliases #437

@Davoski1
Davoski1 requested a review from Miracle656 as a code owner July 29, 2026 16:59
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@rhoggs-bot-test-account is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Davoski1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Miracle656

Copy link
Copy Markdown
Owner

Please rebase onto main. app.config.ts has replaced app.json/app.config.js, and frontend/mobile/tsconfig.json + network.ts have both changed since this was opened. Rebase and re-scope the path-alias change to the current tsconfig.json, dropping the duplicate config file, and I'll re-review.

@Miracle656

Copy link
Copy Markdown
Owner

Thanks @Davoski1 — reviewed. Mixed after the config migration:

Could you close this and open a focused PR for just the rpId/origin env support? It pairs well with the native passkey wiring that just landed in #594. If you still want the tsconfig @/* → ./* change, please confirm it doesn't break existing @/app/... imports and send it separately.

@Miracle656

Copy link
Copy Markdown
Owner

Apologies — this sat unreviewed for a month while main moved underneath it, and that is on us, not you.

What happened: PR #508 (3a9e337, "register veil:// scheme and universal/app links") landed after you opened this. It did the same job from the other direction:

  • Added associatedDomains to frontend/mobile/app.config.ts (line 56)
  • Added Android intentFilters with the assetlinks reference (lines 70–80)
  • Set bundleIdentifier, package and scheme
  • Deleted frontend/mobile/app.json

And the domain-association files are now hosted for real, not as examples:

frontend/wallet/public/.well-known/assetlinks.json
frontend/wallet/public/.well-known/apple-app-site-association

So the gap you were closing is closed. I have checked main rather than assuming.

Specific to this PR: the @/* path alias you added to frontend/mobile/tsconfig.json is already on main — paths is set at line 8 with "@/*" mapped. So that part is done too.

This PR is also cumulative over #585 and #584 (6 files ⊃ 5 ⊃ 3), so all three are in the same position.

Not closing it — your call. Sorry the wait made it moot; the tsconfig instinct was right, it just got there via another PR.

…ath-aliases

# Conflicts:
#	frontend/wallet/lib/network.ts

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved and merging — rebased on your branch (b40c303) and reduced to the tsconfig change this PR is named for.

Aligning @/* with ./* is right, and it matches what frontend/wallet already does. @/* → ./app/* is a slightly odd mapping to have: it makes the root alias mean the routes directory specifically, so @/lib/foo and @/hooks/foo silently fail to resolve while @/components/foo works only because there is a separate, more specific mapping for it.

I checked what actually depends on this before merging, because a path-alias change is the kind of thing that either does nothing or breaks the build. Exactly one @/ import exists in the mobile app today — @/components/ScreenScaffold — and it resolves through the dedicated @/components/* entry, which is more specific and wins either way. So this is a no-op on current code and unblocks the conventional @/lib/... form going forward.

Verified: tsc --noEmit -p tsconfig.typecheck.json clean, 430 tests across 28 suites passing. QuickActions.test.tsx fails, but identically on main — I checked out main and re-ran rather than assuming.

What I dropped: frontend/wallet/lib/network.ts, examples/nextjs/src/lib/network.ts, frontend/mobile/app.config.js and examples/expo/.well-known/* — all carried from your #584 and #585, both of which are now merged. The rpId/origin config landed via #585; the Expo config and .well-known files were superseded by main's app.config.ts and the real files under frontend/wallet/public/, with the reasoning on #584.

That's all three of your PRs in. Thanks — #584 in particular surfaced a genuine iOS passkey bug.

@Miracle656
Miracle656 merged commit b210ea9 into Miracle656:main Sep 3, 2026
7 of 14 checks passed
Miracle656 added a commit that referenced this pull request Sep 3, 2026
The dev client died at launch with:

  Unable to start activity ComponentInfo{xyz.veil.wallet/.MainActivity}:
  java.lang.IllegalArgumentException: App react context shouldn't be created before.
    at DevLauncherAppLoader.createOnDelegateWillBeCreatedListener(DevLauncherAppLoader.kt:49)

Cause: expo-notifications was pinned ^57.0.15 while Expo SDK 54 expects
~0.32.17 -- and unlike every other expo-* dependency here it used a caret, so
it drifted a major version off the SDK. It then bundled its own nested copies
of expo-application@57.0.2 and expo-constants@57.0.15, so the APK contained two
versions of the same native modules. Two Expo module registries means the React
context gets created twice, which is exactly what expo-dev-launcher refuses.

expo-doctor named it once asked:

  Major version mismatches
  package             expected  found
  expo-notifications  ~0.32.17  57.0.15

Fixed with , which resolves the SDK-matched
version. The nested expo-application / expo-constants duplicates are gone with
it.

Two related metro.config.js fixes while here:

-  now maps to the project root, matching tsconfig. #586 widened  from
  ./app/* to ./* but metro still pointed at app/, so an  import
  would typecheck and then fail to resolve at runtime -- invisible to CI,
  because tsc is the only thing that reads tsconfig. That divergence is mine,
  from merging #586 without following it through here.

- react and react-dom are pinned to the app's own copy. Since #670 made each
  package install independently, sdk/node_modules carries react@19.2.8 against
  the app's 19.1.0, and metro follows the symlink into sdk/ to read its
  sources. Two Reacts in one bundle gives two hook dispatchers, surfacing as
  'Invalid hook call' from correct code.

Verified: expo-doctor's SDK-version and duplicate-native-module checks now
pass, metro.config.js loads with both aliases resolving as intended, tsc clean,
430 tests across 28 suites (QuickActions.test.tsx fails identically on main).
Miracle656 added a commit that referenced this pull request Sep 3, 2026
The dev client died at launch with:

  Unable to start activity ComponentInfo{xyz.veil.wallet/.MainActivity}:
  java.lang.IllegalArgumentException: App react context shouldn't be created before.
    at DevLauncherAppLoader.createOnDelegateWillBeCreatedListener(DevLauncherAppLoader.kt:49)

Cause: expo-notifications was pinned ^57.0.15 while Expo SDK 54 expects
~0.32.17 -- and unlike every other expo-* dependency here it used a caret, so
it drifted a major version off the SDK. It then bundled its own nested copies
of expo-application@57.0.2 and expo-constants@57.0.15, so the APK contained
two versions of the same native modules. Two Expo module registries means the
React context gets created twice, which is exactly what expo-dev-launcher
refuses.

expo-doctor named it once asked:

  Major version mismatches
  package             expected  found
  expo-notifications  ~0.32.17  57.0.15

Fixed with "expo install expo-notifications", which resolves the SDK-matched
version. The nested expo-application / expo-constants duplicates go with it.

Two related metro.config.js fixes while here:

- "@" now maps to the project root, matching tsconfig. #586 widened "@/*" from
  ./app/* to ./* but metro still pointed at app/, so an "@/lib/foo" import
  would typecheck and then fail to resolve at runtime -- invisible to CI,
  because tsc is the only thing that reads tsconfig. That divergence is mine,
  from merging #586 without following it through here.

- react and react-dom are pinned to the app's own copy. Since #670 made each
  package install independently, sdk/node_modules carries react@19.2.8 against
  the app's 19.1.0, and metro follows the symlink into sdk/ to read its
  sources. Two Reacts in one bundle gives two hook dispatchers, surfacing as
  "Invalid hook call" from code that is perfectly correct.

Verified: expo-doctor's SDK-version and duplicate-native-module checks now
pass, metro.config.js loads with both aliases resolving as intended, tsc
clean, 430 tests across 28 suites (QuickActions.test.tsx fails identically on
main).
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.

9. tsconfig + path aliases

2 participants