Hi All,
I am currently developing a mobile React Native app using Expo. I’ve successfully created the project using the Expo CLI and have connected it to an iOS simulator via Xcode. The base application runs fine without any issues.
However, I encountered problems when attempting to integrate Foundry using the OSDK. I followed the standard setup steps:
- Exported my Foundry token (
FOUNDRY_TOKEN
). - Added the
.npmrc
configuration for the registry. - Installed the required packages:
- Initialized the
createClient
and attempted to fetch objects as per the provided example in the documentation.
When running the application (npx expo start
→ Press i
for the iOS simulator), I keep encountering the error:
Unable to resolve "@osdk/client"
from “FoundryClient.tsx”`
I’ve spent significant time debugging this and believe the issue is related to Metro Bundler’s inability to resolve the package properly. The error suggests the @osdk/client
package may not be properly exported under the "exports"
field in its package.json
file, causing Metro Bundler to fail to locate the module during the build process.
Steps to Reproduce:
To reproduce the issue:
- Create a blank Expo TypeScript project:
lua
Copy code
npx create-expo-app FitnessApp --template with-typescript
- Install Foundry OSDK packages using the provided instructions.
- Initialize the
createClient
and attempt to fetch data using the basic client-server setup. - Run the project:
sql
Copy code
npx expo start
- Open the iOS simulator using
i
.
Current Behavior:
The Metro Bundler fails with the error:
Unable to resolve "@osdk/client"
from “FoundryClient.tsx”`
I would greatly appreciate any insights or solutions on how to properly configure Metro Bundler or the package.json
exports to resolve this issue.
Thank you in advance for your help!
Best Regards,
Sam