@nx/expo - Latest expo/cli breaks tasks
Current Behavior
When running latest expo/[email protected], modules are unable to resolve and bundle 404's
Expected Behavior
Should work as expected in expo/[email protected], where modules resolve and bundle loads.
GitHub Repo
https://github.com/pk1m/test-expo-cli-bug
Steps to Reproduce
- run
npx nx run test-app:start - open web app, bundle will 404
Nx Report
NX Report complete - copy this into the issue template
Node : 24.0.1
OS : darwin-arm64
Native Target : aarch64-macos
npm : 11.3.0
nx : 22.1.1
@nx/js : 22.1.1
@nx/jest : 22.1.1
@nx/eslint : 22.1.1
@nx/workspace : 22.1.1
@nx/detox : 22.1.1
@nx/devkit : 22.1.1
@nx/expo : 22.1.1
@nx/module-federation : 22.1.1
@nx/react : 22.1.1
@nx/rollup : 22.1.1
@nx/vite : 22.1.1
@nx/vitest : 22.1.1
@nx/web : 22.1.1
typescript : 5.9.3
---------------------------------------
Registered Plugins:
@nx/expo/plugin
---------------------------------------
Cache Usage: 0.00 B / 46.04 GB
Failure Logs
Package Manager Version
No response
Operating System
- [x] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
For some background, I was attempting to update expo/cli to latest to resolve HMR issue I noticed.
But when running nx/expo targets using expo/[email protected] the bundle fails to load with "type": "UnableToResolveError". This is reproducible in the repo i linked above.
Running expo start from the app directory works as expected.
I investigated a little bit and noticed a difference between (what was working for me) expo/[email protected] and expo/[email protected]
I added some logging and noticed that there is some double pathing going on.
expo/[email protected]
expo:metro:withMetroResolvers Custom resolver (requestPostRewrites) threw: FailedToResolvePathError. (module: ./apps/test-app/index, platform: web, env: undefined, origin: /Users/takim/Code/expo-cli-bug-repro/apps/test-app/.)
expo/[email protected]
(module: ./apps/test-app/index, platform: web, env: undefined, origin: /Users/takim/Code/expo-cli-bug-repro/.)
the origin in the latest expo/cli resolves to the project root when before it was the workspace root. this causes metro to be unable to find the module since its trying to resolve /Users/takim/Code/expo-cli-bug-repro/apps/test-app/apps/test-app/index
not sure where this bug should be opened so i opened it in both https://github.com/expo/expo/issues/41209