Does not working with react native 0.60.4 - Invariant Violation
See original GitHub issueFacing a issue with react-native-svg-transformer with react native latest version 0.60.4
- react-native-svg is working fine with react-native 0.60.4
This is public git repo I have created for example react-native-svg-transformer with react-native 0.60.4 - https://github.com/dilipchandima/reactNative6SVG
following are my configurations for react native
package.json
{
"name": "svg",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-svg": "^9.5.3"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"eslint": "^6.1.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-native-svg-transformer": "^0.13.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
metro.config
const { getDefaultConfig, mergeConfig } = require("metro-config");
const svgModule = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
}),
babelTransformerPath: require.resolve("react-native-svg-transformer")
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
}
};
})();
const defaultModule = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
module.exports = mergeConfig(svgModule, defaultModule);
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Updating to React Native 0.60.4, Jest failing with Invariant ...
After updating to RN0.60.4 from RN0.59.10, some of my jest tests are failing with. Invariant Violation: __fbBatchedBridgeConfig is not set, ...
Read more >@react-native-picker/picker - npm
For React Native v0.60 and above (Autolinking). As react-native@0.60 and above supports autolinking there is no need to run the linking process.
Read more >Upgrading to new versions - React Native
Some upgrades won't be done automatically with the React Native CLI and require manual work, e.g. 0.28 to 0.29 , or 0.56 to...
Read more >invariant violation: module appregistry is not a registered ...
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle...
Read more >Troubleshooting | React Navigation
Sometimes it might even be due to a corrupt installation. If clearing cache didn't work, try deleting your node_modules folder and run npm...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
after I change the metro config as following it works
If anyone is using Expo with their project, restart the development server. Apparently you need to do this to load config file correctly. It’s such a simple thing that anyone could miss but that helped me out after getting the same exact error. Can confirm this is working with default metro.config.js, typescript declaration file, .svgrrc file, and app.json settings.