'TypeError: source.split is not a function. (In 'source.split('\n')', 'source.split' is undefined)

I am getting this error while working in react native I don't know why this is happening. I am getting this error and then the app reloads automatically. I think this used in some packages. I didn't use any split function in my app.

[Mon Dec 28 2020 00:06:36.425]  ERROR    TypeError: source.split is not a function. (In 'source.split('\n')', 'source.split' is undefined)     

This error is located at:
    in SvgXml (at register.js:214)
    in RCTView (at View.js:34)
    in View (at register.js:213)
    in RCTView (at View.js:34)
    in View (at register.js:212)
    in RCTView (at View.js:34)
    in View (at register.js:198)
    in RCTView (at View.js:34)
........................
..........
...........
    in Root (at connectStyle.js:392)
    in Styled(Root) (at RootComponent.js:7)
    in RootComponent (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)


Solution 1:[1]

I went through this error in my app and it was related to lib react-native-svg specifically because I haven't added a configuration to use svgXml.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alycecristines