Skip to content

fix: Google Fonts css2 URL 400 Bad Request (Roboto weight syntax)#122

Merged
mkayander merged 5 commits intomainfrom
cursor/google-fonts-bad-request-11ad
Apr 8, 2026
Merged

fix: Google Fonts css2 URL 400 Bad Request (Roboto weight syntax)#122
mkayander merged 5 commits intomainfrom
cursor/google-fonts-bad-request-11ad

Conversation

@mkayander
Copy link
Copy Markdown
Owner

@mkayander mkayander commented Apr 7, 2026

Problem

The combined Google Fonts URL in _document.tsx mixed CSS2 with legacy v1 syntax for Roboto, which returned 400 Bad Request.

Changes

  • Fonts: Inter + Space Grotesk via next/font; Roboto / unused Share Tech removed; Material Icons link kept.
  • Turbopack: variable options in appFonts.ts must be string literals.
  • Client fix: Import #/shared/fonts/appFonts from pages/_app.tsx. pages/_document.tsx is server-only, so importing next/font only there did not put @font-face / --font-app-* definitions in the client bundle — var(--font-app-sans) was invalid and the UI fell back to Times New Roman.

Verification

  • pnpm run build — pass
  • pnpm test — pass (earlier)
Open in Web Open in Cursor 

The css2 endpoint rejects legacy v1 syntax (colon-separated weights),
which returned 400 Bad Request. Use wght@300;400;500;700 for Roboto.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dstruct Ready Ready Preview, Comment Apr 7, 2026 6:31pm

cursoragent and others added 2 commits April 7, 2026 10:19
- Remove unused Roboto and Share Tech from the Google Fonts bundle
- Apply font CSS variables on Html; drop duplicate text-font stylesheet
- Align MUI typography, globals.css, and app bar wordmark with shared stacks
- Split fontVariables (theme-safe) from appFonts (next/font entry)

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@mkayander mkayander marked this pull request as ready for review April 7, 2026 17:56
Turbopack requires explicit string literals for the font loader's
`variable` option; imported constants fail the build.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
_document is server-only; next/font side effects were not in the client
bundle, so --font-app-* stayed undefined and body fell back to serif.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@mkayander mkayander merged commit a31b96b into main Apr 8, 2026
6 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 8, 2026
## [1.374.3](v1.374.2...v1.374.3) (2026-04-08)

### Bug Fixes

* Google Fonts css2 URL 400 Bad Request (Roboto weight syntax) ([#122](#122)) ([a31b96b](a31b96b))
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 This PR is included in version 1.374.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants