Trouble with path for vercel deployment
Answered
remii posted this in #help-forum
remiiOP
Previously posted here asking for help on pathing my local fonts (answered).
#Trouble with path for next/font/local
With this solution however, the vercel deployment is failing with
I think I should mention that during setup i kept everything regarding what the root directory was at default (./)
The github repo used in the previous forum is also the same file structure as my current development repo
#Trouble with path for next/font/local
With this solution however, the vercel deployment is failing with
Module not found: Can't resolve '../../../public/public/fonts/helveticaneue-light.otf'
I think I should mention that during setup i kept everything regarding what the root directory was at default (./)
The github repo used in the previous forum is also the same file structure as my current development repo
19 Replies
remiiOP
Attempting other file paths that have failed:
Code: "/public/fonts/helveticaneue-light.otf"
Vercel Error:
Code: "/public/fonts/helveticaneue-light.otf"
Vercel Error:
Module not found: Can't resolve './/public/fonts/helveticaneue-light.otf'
The actual file
make sure you're using
..
to go back a foler@Anay-208 | Ping in replies make sure you're using `..` to go back a foler
remiiOP
public/fonts/helveticaneue-light.otf
The path needs to be absolute
@remii public/fonts/helveticaneue-light.otf
If your file is in src/app/layout.tsx, you have to prefix “../../“ to the path
remiiOP
hmm i think understand what your saying
i have all my fonts in fonts.ts which has a path src/app/ui/fonts.ts
@Anay-208 | Ping in replies If your file is in src/app/layout.tsx, you have to prefix “../../“ to the path
remiiOP
so the absolute prefix would be "../../../" correct?
granted i also just tried ur suggested path an it still gave the vercel error
@remii granted i also just tried ur suggested path an it still gave the vercel error
Can you share screenshot of your project structure
../../../public/fonts/helveticaneue-light.otf
Answer
I’m error if you see, you added public twice
remiiOP
💀 im unserious lol. preciate it, its deployed