react-native-svg: Can not resolve module
Hey 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
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27
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-545573905I could not manage to resolve issue by @RobertMeGusta comments. Still having the same problem 😦 Do you have any other suggestions
npm i react-native-svg
solved for meI think problem is with react-native-svg >= 12.0.0. Yarn add react-native-svg@11.0.0 solved all issues
npm i react-native-svg
work for me toTo reconfirm this can be resolved, when using
metro.config.js
by adding “ts” and “tsx” to thesourceExts
as follows:I did already :
expo init test
yarn add react-native-svg@9.13.2
expo eject
=> ExpoKitcd ios && pod install
expo start -c
Build and Run
on XcodeAnd everything works fine 😕
Hi I have the same error for a few hours I already deleted modules reinstall from scratch and I don’t have the solution
Loading dependency graph, done. error: bundling failed: Error: Unable to resolve module
css-selectfrom
D:\Developement\dos\CloudMobile\SiigoApp\node_modules\react-native-svg\src\css.tsx: Module
css-select` does not exist in the Haste module mapThis might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:
watchman watch-del-all
.node_modules
folder:rm -rf node_modules && npm install
.rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
.rm -rf /tmp/haste-map-react-native-packager-*
.`this from today, do you know how I can fix it?