Skip to content

[v4][Nextjs] Import google font in global.css is broken when deployed on Production. #17006

Closed Answered by Aman3899
khoatran2014 asked this question in Help
Discussion options

You must be logged in to vote

It looks like your Google Fonts are not loading correctly in production but work fine in development. Here are some possible reasons and solutions:


Possible Causes & Fixes

1. Incorrect @import syntax in V4

Your updated V4 syntax is incorrect. The @import statement should not be followed by layer(base);. Instead, follow the standard import format.

✅ Solution: Use the correct @import syntax

Modify your global.css to this:

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght@100..700");

@tailwind base;
@tailwind components;
@tailwind util…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by khoatran2014
Comment options

You must be logged in to vote
1 reply
@Aman3899
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants