react-native-svg-transformer icon indicating copy to clipboard operation
react-native-svg-transformer copied to clipboard

Unable to resolve module

Open rodrigodiasf1984 opened this issue 9 months ago • 7 comments

Hi , i'm working with the react-native 0.74.1 and i've followed de documentation to install this package:

image

How can i fix it? Thanks

rodrigodiasf1984 avatar May 09 '24 14:05 rodrigodiasf1984

i've opened an new question on the stackOverflow as well: https://stackoverflow.com/questions/78458785/react-native-v0-74-1-unable-to-resolve-module-when-importing-svg

rodrigodiasf1984 avatar May 10 '24 09:05 rodrigodiasf1984

I just updated the demo app (https://github.com/kristerkari/react-native-svg-example) to 0.74.1, and it is working.

I'm not sure about your problem, but a very common problem with configuring this library is that people don't restart the Metro packager after changing the Metro config.

kristerkari avatar May 14 '24 18:05 kristerkari

same issue, but I found there is not the svg file really. fixed path and soloved

baryon avatar May 15 '24 23:05 baryon

I just updated the demo app (https://github.com/kristerkari/react-native-svg-example) to 0.74.1, and it is working.

I'm not sure about your problem, but a very common problem with configuring this library is that people don't restart the Metro packager after changing the Metro config.

Thanks for your help I've used to close the metro after installing a library when I got an error and also yarn --reset-cache. I've looked at your example and I noticed something different, by default the new version of react-native adds this to the extends at the tsconfig.json(by the away your example uses webpack and I couldn't compare the tsconfig.json)

"extends": "@react-native/typescript-config/tsconfig.json",

So I was digging into my other projects and I replaced this extends with the old extends in previous versions of react-native, and the error is gone and I'm able to import the SVG file write now. I'm not sure if this is the best solution.

image

rodrigodiasf1984 avatar May 16 '24 06:05 rodrigodiasf1984

@rodrigodiasf1984 Did you install react-native-svg as well? I had the same issue, and adding it solved the error.

kingajohanna avatar Jun 13 '24 11:06 kingajohanna

@rodrigodiasf1984 Did you install react-native-svg as well? I had the same issue, and adding it solved the error.

yes i did, i've "react-native-svg": "^15.2.0" installed

rodrigodiasf1984 avatar Jun 13 '24 11:06 rodrigodiasf1984

Same problem after install sentry

khanhkom avatar Oct 08 '24 09:10 khanhkom