3
votes

I am new in react native. After install new library of react-native-svg-from-uri. and used in my component like

import SvgUri from 'react-native-svg-uri';
<SvgUri width="200" height="200" source={require("./img/homer.svg")} />

when running my app it shows error

Unable to resolve "./patternReg" from "node_modules\react-native-svg\lib\extract\extractProps.js.

now how to solve this problem? Thanks in advance.

3
I just installed react-native-svg to use the Victory charting package and am getting the same error. - Fiid

3 Answers

3
votes

I solve this runing this command:

npm i react-native-svg@^5.4.0
2
votes

If you created your App with create-react-native-app, then it was created with Expo, which already includes react-native-svg.

Try removing react-native-svg to avoid duplicate/mismatched dependencies.

1
votes

Have you installed react-native-svg, looks like the library you are using require another module react-native-svg, try installing it and also link react-native-svg.

try following steps.

1> npm i react-native-svg

2> react-native link react-native-svg

3> npm install react-native-svg-uri --save

4> re-run the project

Note: Make sure you have linked project correctly.