question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native 0.66.4 - Invariant Violation: View config getter callback for component ...

See original GitHub issue

I’ve using the RN 0.66.4 version, react-native-svg ^12.1.1 and react-native-svg-transformer ^1.0.0.

I’ve this error for all tries that I did.

Invariant Violation: View config getter callback for component `<svg width="41" height="40" viewBox="0 0 41 40" fill="none" >...` ...
must be a function (received `undefined`).

This error is located at:
    in <svg ...

Simulator Screen Shot - iPhone 13 - 2022-01-05 at 21 23 43

my metro.config.js:

const {getDefaultConfig} = require('metro-config');

module.exports = (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'],
    },
  };
})();

So, the react-native-svg-transformer is not available for this version?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
kristerkaricommented, Jan 19, 2022

@DwCleb sorry for the late response, but I had a look at your project, and it’s the babel-plugin-inline-import that is messing things up. I tried removing that Babel plugin from your project and it fixed the error.

0reactions
gegnewcommented, Nov 15, 2022

Same problem, but this does not fix it for me; any idea what else could cause this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

view config getter callback for component 'div' must be a ...
Sometimes this error occurs when the import of your component is not correct. In my react-native project, FlatList got imported from ...
Read more >
React Native: View config getter callback for component must ...
You're coding a React Native App and suddenly get an unexpected error: Invariant Violation: View config getter callback for component `div` must be...
Read more >
Invariant Violation: View config getter callback for component ...
I am using Android in windows enviroment for build the app. The exemple app by the libary runing in my machine. By with...
Read more >
Am i losing it ? I think i'm losing it. : r/reactnative - Reddit
"Invariant Violation: View config getter callback for component ... Why is the react native vector icons module README like 20000 char long ...
Read more >
Troubleshooting | React Navigation
Missing extensions in metro configuration​. Sometimes the error may look like this: Error: While trying to resolve module "@react-navigation/native ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found