Font not loaded in Production | Next.js
dev-inpresence
HOBBYOP

8 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

$10 Bounty

2 Replies

dev-inpresence
HOBBYOP

8 months ago

7b2c3f9d-1c57-409a-ac7a-a7504464b44f


phoenixauro
HOBBY

8 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'


Loading...