Can not resolve module
See original GitHub issueHey guys, I recently ejected my app and updated to ExpoKit 35, and since then, I can’t launch the app on iOS anymore because there’s a problem with the react-native-svg module.
Commands :
expo install react-native-svg
cd ios && pod install
cd .. && expo start -c
Build and run
on Xcode
Error below :
While trying to resolve module
react-native-svg
from file/project/assets/illustrations/demo.svg
, the package/project/node_modules/react-native-svg/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/project/node_modules/react-native-svg/src/index.ts
. Indeed, none of these files exist:
/project/node_modules/react-native-svg/src/index.ts(.native||.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.svg|.native.svg|.svg|.ios.json|.native.json|.json)
/project/node_modules/react-native-svg/src/index.ts/index(.native||.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.svg|.native.svg|.svg|.ios.json|.native.json|.json)
Any of you guys had this issue before ? Any help appreciated 😃
I am currently using the following versions :
Expo : 35.0.0 ExpoKit : 35.0.1 React-native : https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz ( SDK 35 ) React-native-svg : 9.12.0 ( When installing, yarn says that version ~9.9.2 is required, but it gaves me the same error anyways ) CocoaPods : 1.8.3 Xcode : 11.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:26
Top GitHub Comments
I had the same issue, with same steps and same outcome. Figured out that in my app.json i had
"packagerOpts": { "config": "metro.config.js", "sourceExts": ["js","jsx","svg",] },
insead of"packagerOpts": { "config": "metro.config.js", "sourceExts": [ "js","jsx","svg","ts","tsx"] },
changing that fixed my issue@feliperoan Can you try v9.13.2? Or
yarn add css-tree css-select
https://github.com/react-native-community/react-native-svg/issues/1166#issuecomment-545573905