Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bahmutov opened this issue Jun 21, 2021 · 6 comments
Labels
🐛 bug Something isn't working

Comments

@bahmutov
Copy link

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.

@Robdel12
Copy link
Contributor

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 & percy/percy-protractor#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

@bahmutov
Copy link
Author

bahmutov commented Jun 21, 2021 via email

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 3, 2021
@Robdel12 Robdel12 added 🍞 stale Closed due to inactivity 🐛 bug Something isn't working and removed Stale 🍞 stale Closed due to inactivity labels Aug 3, 2021
@Robdel12 Robdel12 changed the title Material icons from ReactNative are missing Material icons from ReactNative are missing (woff fonts corrupt on asset discovery capture) Aug 3, 2021
@Robdel12
Copy link
Contributor

Upgrading the latest CLI (v1.1.4) will solve this! https://github.com/percy/cli/releases/tag/v1.1.4

@bahmutov
Copy link
Author

It has solved it, thank you so much @Robdel12

@Robdel12
Copy link
Contributor

Wooo! This problem has been such a long running one. So happy to finally (hopefully) put it to bed 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants