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.

Material icons from ReactNative are missing (woff fonts corrupt on asset discovery capture)

See original GitHub issue

In 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

Screen Shot 2021-06-21 at 18 01 24

The visual screenshots in the dashboard show empty placeholder symbol though

https://percy.io/bahmutov/ReactNativeTodo

image

Would be nice to know why it happens and how to mitigate this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bahmutovcommented, May 12, 2022

It has solved it, thank you so much @Robdel12

1reaction
Robdel12commented, Jun 21, 2021

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

image

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

Read more comments on GitHub >

github_iconTop 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 >

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