dev-inpresence
HOBBYOP
9 months ago
I use railway to host my next.js website, and i use Monserrat and Inter font, it work normaly in local/development. But when it come to productions, the font not loaded and fallback to browser default font. I use Next.js 15 here, and already try both why to load font, by using 'next/font/local' and 'next/font/google', and both of them only work on local
thanks in advance
2 Replies
phoenixauro
HOBBY
9 months ago
in the browser network tab see if you are getting a 404 or 403 for the font files.
Also make sure your package.json has
"scripts": {
"build": "next build",
"start": "next start"
}
Also make sure
next.config.js
doesn't have output: 'export'