kristerkari / react-native-svg-transformer

Import SVG files in your React Native project the same way that you would in a Web application.
MIT License
1.54k stars 116 forks source link

Attempt to load Expo's upstream transformer if it's available #328

Closed rbright closed 6 months ago

rbright commented 6 months ago

Expo v50 now uses its own upstream transformer instead of metro-react-native-babel-transformer.

This causes the error in the Metro configuration, as the library currently attempts to use metro-react-native-babel-transformer as the upstream.

node_modules/expo-router/_ctx.ios.js: Expected `fromDir` to be of type `string`, got `undefined`` to be thrown when attempting to use `react-native-svg-transformer`

To resolve this, we can attempt to first load Expo's transformer and then attempt loading metro-react-native-babel-transformer.

kristerkari commented 6 months ago

Thanks! I think that this a good fix to make, but let me just test it out myself first :)

kristerkari commented 6 months ago

Looks like it it's working, thanks a lot! 👍

brentvatne commented 5 months ago

hey there, i just noticed this from some discussion in the expo repo and wanted to say thanks for this pr!