You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an Expo React Native app that we run using Tauri. It works fine on Windows, but there's a strange issue on macOS. When running the app on macOS through Tauri, the fonts fail to load correctly (although the app works fine when run in a browser on macOS, both in Safari and Chrome).
The issue is that the fonts don't load as expected. More specifically, they seem to load (everything is displayed correctly), but useFonts returns Error: 6000ms timeout exceeded.
Under the hood, useFonts (from expo-font) uses document.fonts.load(...). When I tried calling this function directly, I encountered the same issue: the callback was only triggered once (should be called 5 times). However, when I used document.fonts.ready, it indicated that all fonts were loaded.
As a workaround, we now use a combination of useFonts and document.fonts.ready.
Interestingly, if I only load one font, the error doesn’t occur. I also tried increasing the timeout to 60 seconds, but the same error persisted.
amrbashir
changed the title
[bug] Issue with loading fonts in expo RN app with Tauri on MacOS
[bug] [macOS] Issue with loading fonts in expo RN app with Tauri on MacOS
Sep 26, 2024
Describe the bug
We have an Expo React Native app that we run using Tauri. It works fine on Windows, but there's a strange issue on macOS. When running the app on macOS through Tauri, the fonts fail to load correctly (although the app works fine when run in a browser on macOS, both in Safari and Chrome).
The issue is that the fonts don't load as expected. More specifically, they seem to load (everything is displayed correctly), but
useFonts
returnsError: 6000ms timeout exceeded
.Under the hood,
useFonts
(from expo-font) usesdocument.fonts.load(...)
. When I tried calling this function directly, I encountered the same issue: the callback was only triggered once (should be called 5 times). However, when I useddocument.fonts.ready
, it indicated that all fonts were loaded.As a workaround, we now use a combination of
useFonts
anddocument.fonts.ready
.Interestingly, if I only load one font, the error doesn’t occur. I also tried increasing the timeout to 60 seconds, but the same error persisted.
Reproduction
No response
Expected behavior
No error while loading fonts.
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: