Skip to content

Turbopack uses wrong font url with inline css #83612

@Arctomachine

Description

@Arctomachine

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/compassionate-framework-57kfnd?workspaceId=ws_X5ioCfD3ad1j2YXggVVUif

To Reproduce

  1. Run in dev to see how it should look
  2. Build and run in start to see how it actually looks

Current vs. Expected behavior

When building production with turbopack and inline css enabled, font url is wrong. It gives 404 and uses fallback system font. Happens with next/font/google, not tested with other options

Current: uses fallback font

Image

Expected: uses selected font

Image

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.5.1-canary.35 // Latest available version is detected (15.5.1-canary.35).
  eslint-config-next: N/A
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.3.3
Next.js Config:
  output: N/A

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

CSS, Font (next/font), Turbopack

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

next build (local), next start (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSSRelated to CSS.Font (next/font)Related to Next.js Font Optimization.TurbopackRelated to Turbopack with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions