Module not found: Can't resolve './/fonts/Satoshi-Black.otf'
Unanswered
Cão de Castro Laboreiro posted this in #help-forum
Cão de Castro LaboreiroOP
Hi guys,
I have been encountering this error when tring to use localfont. what I don't understand is that it was working perfectly I didn't change anything and now reopening the project or trying to use localfont in new projects throws me this error. here is the code
I have been encountering this error when tring to use localfont. what I don't understand is that it was working perfectly I didn't change anything and now reopening the project or trying to use localfont in new projects throws me this error. here is the code
6 Replies
@Cão de Castro Laboreiro Hi guys,
I have been encountering this error when tring to use localfont. what I don't understand is that it was working perfectly I didn't change anything and now reopening the project or trying to use localfont in new projects throws me this error. here is the code
It has to be the file system path, not the url. So something like ../../public/fonts/satoshi.otf
This is why you should just put the font files in the same folder, so that you can use "./satoshi.otf" as the path
You don’t need to put it inside the public folder
Cão de Castro LaboreiroOP
Thanks Jouley for taking the time to reply. Unfortunately I tried what you said and it still didn’t work. I’ve tried placing the fonts at different levels still didn’t work
Cão de Castro LaboreiroOP
@joulev I’m getting an additional issue where my Images are not loading anymore on my local server. This is very weird I haven’t changed a single thing in the code
@Cão de Castro Laboreiro Thanks Jouley for taking the time to reply. Unfortunately I tried what you said and it still didn’t work. I’ve tried placing the fonts at different levels still didn’t work
I’ll need to see your folder structure. Where are the font files and the file declaring localFont stored?