Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turbopack build does not correctly resolve fonts from next/fonts #77861

Open
stefanprobst opened this issue Apr 5, 2025 · 0 comments
Open

turbopack build does not correctly resolve fonts from next/fonts #77861

stefanprobst opened this issue Apr 5, 2025 · 0 comments
Labels
Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js.

Comments

@stefanprobst
Copy link
Contributor

stefanprobst commented Apr 5, 2025

Link to the code that reproduces this issue

https://github.com/stefanprobst/issue-next-turbo-fonts

To Reproduce

  1. clone repo, pnpm install
  2. pnpm build (which runs next build --turbopack) and pnpm start (which runs next start --turbopack)
  3. open http://localhost:3000 and inspect the <h1> which does not have "Geist" font family applied
  4. for comparison, inspect the h1 after running either pnpm dev (which runs next dev --turbopack) or run pnpm build:webpack && pnpm start:webpack - in all these cases the h1 has the correct "Geist" font-family applied.
  5. NOTE: when next/font is not imported in the not-found page here it does work correctly with turbopack build as well.

Current vs. Expected behavior

turbopack build should behave like webpack build/dev, and turbopack dev.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #202403151937 SMP PREEMPT_DYNAMIC Fri Mar 15 19:52:22 UTC 2024
  Available memory (MB): 31401
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: 10.6.2
Relevant Packages:
  next: 15.3.0-canary.38 // Latest available version is detected (15.3.0-canary.38).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack, Font (next/font)

Which stage(s) are affected? (Select all that apply)

next build (local)

@github-actions github-actions bot added Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js. labels Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant