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-svgcd ios && pod installcd .. && expo start -cBuild and runon Xcode
Error below :
While trying to resolve module
react-native-svgfrom file/project/assets/illustrations/demo.svg, the package/project/node_modules/react-native-svg/package.jsonwas successfully found. However, this package itself specifies amainmodule 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 Related StackOverflow Question
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-selecthttps://github.com/react-native-community/react-native-svg/issues/1166#issuecomment-545573905