InvalidCharacterError: String contains an invalid character
See original GitHub issueHi,
Running a project with Expo, I am getting an InvalidCharacterError: String contains an invalid character
error on the web rendering. Android works fine and I haven’t tested iOS.
I have the following dependencies in my package.json
:
{
...
"dependencies": {
"expo": "~37.0.3",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-svg": "11.0.1",
"react-native-web": "~0.11.7"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"babel-preset-expo": "~8.1.0",
"react-native-svg-transformer": "^0.14.3"
}
}
Here is my App.js
, the Bower SVG was taken from react-native-svg-example:
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Bower from './assets/bower.svg';
export default function App() {
return (
<View style={styles.container}>
<Bower width={256} height={256} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Does anyone have an idea of what’s going on?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top Results From Across the Web
'String contains an invalid character' when using document ...
The string you pass to document.createElement is the type of the element, e.g. tr . If you really want to assemble your HTML...
Read more >1627511 - "String contains an invalid character" even though ...
I receive the error "InvalidCharacterError: String contains an invalid character". This is confusing because all characters in the string are valid base 64....
Read more >Uncaught DOMException: String contains an invalid character ...
Hi, all. I've been looking through my code, trying to find where the stray character is, but I just cannot find it.
Read more >InvalidCharacterError: String contains an invalid character
InvalidCharacterError : String contains an invalid character. ... email subject contains: č; response contains: ď. Other characters with ...
Read more >The message contains invalid characters. - Apple Developer
I'm trying to post a legitimate question but I keep getting this error that says "The message contains invalid characters." I tried "rephrasing"...
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
This transformer only seems to be used for Android and iOS.
For Web, I found that I needed the following
webpack.config.js
:For completeness, this is what I added to
package.json
:and for Android into
metro.config.js
:I also have added the following to
app.json
but have no idea if it is necessary:@Beetix did you found a solution or some kind of workaround? Have the same problem