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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font.loadAsync failing on safari (and mobile safari) in web #6940

Closed
chrisdrackett opened this issue Feb 1, 2020 · 3 comments 路 Fixed by #7060 or #7420
Closed

Font.loadAsync failing on safari (and mobile safari) in web #6940

chrisdrackett opened this issue Feb 1, 2020 · 3 comments 路 Fixed by #7060 or #7420
Assignees
Labels
bug Platform: web Using Expo in the browser

Comments

@chrisdrackett
Copy link
Contributor

馃悰 Bug Report

Environment

Expo CLI 3.8.0 environment info:
System:
OS: macOS 10.15.2
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
IDEs:
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmGlobalPackages:
expo-cli: 3.8.0

Targeting Web

Steps to Reproduce

add

    Font.loadAsync({
      'FontName': require(`./fonts/FontName.ttf`),
    }),

to app and start app

Expected Behavior

fonts load and promise resolves without error

Actual Behavior

Get Unhandled Promise Rejection: Error: 3000ms timeout exceeded

Reproducible Demo

https://snack.expo.io/@chrisdrackett/brave-raspberries

replace the above placeholder with a real font (can't seem to add in a snack) and run on safari.

@EvanBacon EvanBacon added the Platform: web Using Expo in the browser label Feb 4, 2020
@EvanBacon EvanBacon self-assigned this Feb 4, 2020
@gianpaj
Copy link
Contributor

gianpaj commented Feb 24, 2020

same issue on Firefox. Tested on Firefox Desktop 74.0 on a Mac

Error: 3000ms timeout exceeded 10

This should be added to the isFontLoadingListenerSupported() function:

+    const isFirefox = userAgent.includes('Firefox');
+    return !isSafari && !isIOS && !isEdge && !isFirefox;
-    return !isSafari && !isIOS && !isEdge;

@mauriciord
Copy link
Contributor

mauriciord commented Mar 20, 2020

Same as @gianpaj

The PR is here 馃憞馃徎: #7420

@marco2216
Copy link

Hi, we have a similar issue on web, when using the useFonts hook. This error is returned from the hook.
It only occurs on some platforms; I can reproduce it on latest Chrome for Windows, but not MacOS. It only seems to occur when the tab is being loaded in the background, (e.g. open a page in a new tab, wait for the spinner to disappear, then open the tab). It is very inconsistent though and only happens maybe 1/20 times for me when opening a bunch of tabs at the same time, but some of our users are experiencing this issue often.
Fonts seem to be loaded when looking at the network events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Platform: web Using Expo in the browser
Projects
None yet
5 participants