-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: unable to import other workspace packages into expo #953
Comments
Maybe try this https://metrobundler.dev/docs/package-exports/ |
I have now added the following to the same
It would be good if someone can validate this as I have no experience working with a monorepo. Basically, after looking more in depth at the error shown on my device it looks like the module was resolved from
|
Thanks! |
@Mirthis just following up here - I'm trying to use |
@adamspotlite yes that should do it. So in After each change re-run |
Provide environment information
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 2.81 GB / 15.80 GB
Binaries:
Node: 21.7.1 - C:\Program Files\nodejs\node.EXE
npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.15.5 - ~\AppData\Local\pnpm\pnpm.EXE
Describe the bug
I'm facing an issue when importing packages created in other workspaces into expo (I assume this is not the case for devDependencies as they don't end up in the final bundle).
I originally found this problem when creating a new lib workspace that I'm able to use within the
api
workspace, but not in theexpo
workspace.Just to rule out me having made any mistake with the new package, I've tried the same with the existing
validators
package and I'm getting the same error.I can see
@acme/validators
under thenode_modules
folder in the expo directory but it looks like the metro bundler cannot resolve it.I think this may be similar to the issue report here.
To replicate this I attached a repo where I have:
TEST_IMPORT
in/packages/validators/src/index.ts
"@acme/validators": "workspace:*"
inpackage.json
inapp/expo
app\expo\src\app\index.tsx
Link to reproduction
https://github.com/Mirthis/create-t3-turbo-expo-import
To reproduce
TEST_IMPORT
variable defined in@acme\validators
is going to be logged in the console in the next app while the expo app will throw aUnable to resolve "@acme/validators"
errorAdditional information
No response
The text was updated successfully, but these errors were encountered: