Problem with loading fonts (an error occurs)

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/>
    );
}

Any Solution ?
Same Error!

Loading and using custom fonts is note primary priority so removed anything. Sorry but i cant help you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.