TanStack AI version#
0.5.1
Framework/Library version#
Expo SDK 52, Metro bundler, React Native
Describe the bug and the steps to reproduce it#
All @tanstack/ai packages use ESM-only exports (only import condition in exports map). Metro bundler in React Native/Expo cannot resolve them, including subpath exports like ./adapters. This affects both client-side bundling and API route bundling even with unstable_enablePackageExports: true and unstable_conditionNames configured.
Cannot resolve @tanstack/ai/adapters
Workaround: Manually add default condition to all exports in node_modules/@tanstack/ai/package.json:
json"./adapters": {
"types": "./dist/esm/activities/index.d.ts",
"default": "./dist/esm/activities/index.js",
"import": "./dist/esm/activities/index.js"
}
Fix required: Add require or default condition to all package exports.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
Snack
Screenshots or Videos (Optional)#
No response
Do you intend to try to help solve this bug with your own PR?#
Yes, I think I know how to fix it and will discuss it in the comments of this issue
Terms & Code of Conduct#
we have an example app using metro + expo on latest main, use it as a reference and see if this is still an issue, i managed to create a working expo app without cjs! if i'm wrong please lmk and feel free to re-open