Closed ser-emejia closed 1 year ago
Hey @ser-emejia
Are you using Expo, right? Do you followed the lib documentation and installed the dependency expo-font
to load the font TwemojiMozilla
??
See the official documentation here about custom fonts with Expo or see my example and follow it.
Please, let me know if this dont fix your issue...
๐ AstrOOnauta๐
lib documentation
Yes, I'm using expo, I followed the documentation as you mentioned but same result
Unable to resolve "../../node_modules/react-native-international-phone-number/lib/assets/fonts/TwemojiMozilla.woff2" from "src/utils/index.ts
I load the font in that way:
export const customFonts = {
...mycustomfonts,
TwemojiMozilla: require('../../node_modules/react-native-international-phone-number/lib/assets/fonts/TwemojiMozilla.woff2'),
};
@ser-emejia can you put the font TwemojiMozilla
(from lib) inside a folder called assets
on root of your project (like the example)? Sometimes the Expo has conflicts with this...
So you customFonts will be like this:
export const customFonts = {
...mycustomfonts,
TwemojiMozilla: require('./assets/TwemojiMozilla.woff2'),
};
Same result, I downloaded the font and to my assets
folder, but the problem is the same:
Unable to resolve "../../assets/fonts/TwemojiMozilla.woff2" from "src/utils/index.ts"
By the way,
checking expo documentation I noticed that wff2
font is not supporting in Android
@ser-emejia Im studying a solution for you case..sorry about this :X
@ser-emejia I released a new version fixing this issue! The TwemojiMozilla font will be necessary only to Web version now..
You dont need more load this font to Android or iOS (only Web version now). So, please update your lib to latest v0.7.0.
Please, let me know if this fix your trouble...
๐ AstrOOnauta ๐
Thank you so much for your help and time, it works now on expo, in both, iOS and Android ๐
It's been some time, but I am seeing the same error while loading the font for web. @AstrOOnauta I am running react native web. and it breaks. Is there something missing?
After update my project to new version
v0.6.7
I'm facing issues to load the font, see screenshot bellow:I followed this suggestion but it does not work.
Thank you for your help!