Skip to content
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

Unable to resolve import of file after upgrading from SDK 48 to 51 in monorepo #29074

Open
jesuscovam opened this issue May 23, 2024 · 3 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@jesuscovam
Copy link

Minimal reproducible example

see summary for reference

What platform(s) does this occur on?

iOS

Did you reproduce this issue in a development build?

No (tested in Expo Go)

Summary

I'm trying to upgrade two expo apps inside a yarn monorepo, the apps were on the SDK 48 and after upgrading to 51 they won't start, they are trying to import a file from within expo from the root of the monorepo but I'm not sure why or which dependency should be update to include it

Screenshot 2024-05-23 at 8 52 11 a m Screenshot 2024-05-23 at 8 52 37 a m

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.1.2
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.8.0 - /opt/homebrew/bin/node
Yarn: 1.22.10 - /opt/homebrew/bin/yarn
npm: 10.2.3 - /opt/homebrew/bin/npm
Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
Android SDK:
API Levels: 33, 33, 34
Build Tools: 30.0.3, 33.0.2
IDEs:
Xcode: 15.4/15F31d - /usr/bin/xcodebuild
npmGlobalPackages:
eas-cli: 9.0.6
expo-cli: 6.3.10
Expo Workflow: managed

Expo Doctor Diagnostics

Screenshot 2024-05-23 at 8 50 07 a m
@jesuscovam jesuscovam added the needs validation Issue needs to be validated label May 23, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels May 23, 2024
@gopidon
Copy link

gopidon commented May 26, 2024

Same here. I upgraded from 49 to 50. Expo is unable to resolve file paths. For example:

In my App.js , I refer to local files using absolute path like import xyzzy from 'gst/apollo/client', where 'gst' is the main directory in which all my expo code exists. All these imports are failing at bundle time.

@gopidon
Copy link

gopidon commented May 26, 2024

Solution for me:

  1. npm i babel-plugin-module-resolver
  2. modify babel.config.js

plugins: [
['module-resolver',
{
alias: {
gst: '.',
},
}
]
],

@jesuscovam
Copy link
Author

Solution for me:

  1. npm i babel-plugin-module-resolver
  2. modify babel.config.js

plugins: [ ['module-resolver', { alias: { gst: '.', }, } ] ],

Thanks for the help! But this wasn't for me 😢

What I'm understanding is that 'expo-modules-core' shouldn't be something I install in my managed expo apps, its like main package for expo installing expo packages in react-native (not managed) apps, but its also a inner dependency of the new expo 51 SDK.
Screenshot 2024-05-26 at 10 24 49 a m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants