Material icons from ReactNative are missing (woff fonts corrupt on asset discovery capture)
See original GitHub issueIn my project https://github.com/bahmutov/ReactNativeTodo I have Material icons loaded on the ReactNative project.
import {MaterialCommunityIcons} from '@expo/vector-icons';
<MaterialCommunityIcons
testID="delete"
name="trash-can"
size={32}
color={Colors.buttonActive}
disabled={progress}
onPress={deleteSelf}
/>
Locally and on CI everything loads just fine, the elements panel shows
The visual screenshots in the dashboard show empty placeholder symbol though
https://percy.io/bahmutov/ReactNativeTodo
Would be nice to know why it happens and how to mitigate this.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error: Unrecognized font family Material Design icons after ...
This solution Working fine. There is 3 info.plist file in ios sub folders. Added above code in all 3 places. Then i Run...
Read more >Addressing common errors in React Native
Explore common React Native errors such as "command not found" and learn about their causes and potential solutions.
Read more >Using Fonts in Photoshop
Manage missing non-Adobe fonts · Manage: Select to open the Manage Missing Fonts dialog. See the steps below. · Replace: Select to replace...
Read more >WebView
WebView objects allow you to display web content as part of your activity layout, ... Called when the window has just acquired or...
Read more >react native ios font problem Code Example
Hiiiiiiiiiiii {fontFamily:'roboto-italic'} سلام به همه دوستان.
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
It has solved it, thank you so much @Robdel12
Hey @bahmutov! Thanks for the issue. Looking at a snapshot, it looks like these fonts are corrupt when captured in asset discovery. This has been an issue for us for a while, and it’s related to how local dev servers are serving up fonts. When we capture those fonts in asset discovery, the response we’re getting from the dev server is Mojibaked. There’s a good amount of debugging that happened in #312 & https://github.com/percy/percy-protractor/issues/222
All the debugging I’ve done shows the fonts are mojibaked by the time we’re even served it in asset discovery. For some reason, dev servers (
http-server
, webpack dev server, etc) aren’t serving fonts with the correct encodings. I haven’t been able to dig into what exactly is going on in those dev servers, but serving it from a real server always fixes the issue (so far from what I’ve seen).We do need to get to the bottom of this. I spent a few hours last week debugging this without much progress (mostly just reconfirming it’s a local server issue).
@wwilsman we might need to dogpile debug this sometime this week and dig through the webpack dev server internals 🤨 It might also be related to common webpack config everyone uses (like an issue with file loaders, or something). I’m not sure, but it’s along those lines somewhere