SDK Version: 37.0.3
Platforms Android
When i try load fonts via the @use-expo/font package or via expo-fonts package it throws an error that says:
Unable to resolve “…/assets/fonts/RobotoCondensed-Bold.tff” from “src\configuration.tsx” Failed building JavaScript bundle.
The error occurs when the require function is called
Here is where the fonts are loaded
// configuration.tsx
import React from "react";
import {
AppLoading
}
from "expo";
import {
useFonts
}
from "@use-expo/font";
interface Props {
component: React.FC<any>;
}
export const InitConfig: React.FC<Props> = ({ component }) => {
const robotoBold = require("../assets/fonts/RobotoCondensed-Bold.tff");
const robotoLight = require("../assets/fonts/RobotoCondensed-Light.tff");
const robotoRegular = require("../assets/fonts/RobotoCondensed-Regular.tff");
const [
fontsHasLoaded
] = useFonts({
robotoBold,
robotoLight,
robotoRegular
});
return (
fontsHasLoaded
?
<React.Fragment>
{component}
</React.Fragment>
:
<AppLoading/>
);
}