ivopr / tamagui-expo

An Expo template with Tamagui
270 stars 22 forks source link

Failed Prop Type `suppressHighlighting`, FontFamily "Inter" is not a system font #40

Closed rabelais88 closed 1 year ago

rabelais88 commented 1 year ago

Reproduction

fresh install with latest commit 94dca1d

$ npx create-expo-app yourappname -t tamagui-expo-template --no-install
$ yarn install
$ yarn android

multiple errors and warnings pop up, hinders debugging with LogBox and console(). however, it does not happen on works based on previous commits of this repository.

Error

the errors below are repeated for multiple times.

# error 1
 ERROR  Warning: Failed prop type: Invalid props.style key `suppressHighlighting` supplied to `Text`.
Bad object: {
  "suppressHighlighting": true,
  "display": "flex",
  "position": "absolute",
  "right": 0
}
# error 2
 ERROR  fontFamily "Inter" is not a system font and has not been loaded through Font.loadAsync.

- If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

- If this is a custom font, be sure to load it with Font.loadAsync.
ivopr commented 1 year ago

by chance, did you update anything?

rabelais88 commented 1 year ago

by chance, did you update anything?

no, this is a clean install.

ivopr commented 1 year ago

can you try updating tamagui with "yarn upgrade:tamagui"? Here for some reason it appears to have worked.

DaEMoN33 commented 1 year ago

Same issue here (I'm a newb) - just tried "yarn ugprade:tamagui" and I get the following:

yarn upgrade:tamagui 13:33 yarn run v1.22.19 $ $npm_execpath up 'tamagui' '@tamagui/*' error Command "up" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tried "yarn upgrade tamagui" and it seems to have done something, but I still get the same Inter font error.

DaEMoN33 commented 1 year ago

Okay, so I found a solution. This is a Tamagui issue - the problem is that expo-font is created twice.

You can simply run this to fix it: rm -rf ./node_modules/expo/node_modules/expo-font

Link to the relevant Tamagui issue: https://github.com/tamagui/tamagui/issues/1448

ivopr commented 1 year ago

@DaEMoN33 for the "up" command to be available you must be using yarn v3

rabelais88 commented 1 year ago

Okay, so I found a solution. This is a Tamagui issue - the problem is that expo-font is created twice.

You can simply run this to fix it: rm -rf ./node_modules/expo/node_modules/expo-font

Link to the relevant Tamagui issue: tamagui/tamagui#1448

thank you @DaEMoN33 . thank you for your assistance @ivopr too. since it is identified as TamaGUI issue, I'll close.

ockam commented 1 year ago

Just did a fresh install of this starter (thanks by the way!) and I get the fontFamily "Inter" is not a system font error.

Tried all fixes suggested here and in the Tamagui ticket without success. What am I missing?

ivopr commented 1 year ago

yeah, I've noticed It came back after upgrading things and no method solved It anymore. honestly, I don't have any Idea why It is happening again, when I yarn why expo-font It shows only one version

ockam commented 1 year ago

If I remove the SplashScreen methods from _layout, and just use if (!loaded) return null, there's no error.

ivopr commented 1 year ago

what If we keep both? did you try?

ockam commented 1 year ago

No, I will.

I tried using @expo-google-fonts/inter instead of Tamagui Inter, but that didn't work either.

I also found this opened issue about SplashScreen. Not sure if it's related.

ockam commented 1 year ago

I confirm that simply adding if (!loaded) return null to _layout fixes the issue.

ivopr commented 1 year ago

@ockam do you want to open a PR with this fix?

ockam commented 1 year ago

@ockam do you want to open a PR with this fix?

PR #45 opened :)