Skip to content

__nextjs_font does not account for basePath #85428

@pixelchutes

Description

@pixelchutes

Link to the code that reproduces this issue

https://github.com/pixelchutes/next-basepath-issue

To Reproduce

  1. Start the application (next dev) -- this issue is reproducible in both webpack and turbopack
  2. Open the site http://localhost:3000/admin (NOTE the configured basePath)
  3. An error will be generated, allowing you to open the Issues Panel

Current vs. Expected behavior

Current Behavior

  1. Click the "1 issue" button to show the Issues Panel
  2. Notice the font family "Geist Mono" is applied to the "Build Error" label
  3. Open DevTools > Network panel, and click the Font tab
  4. Refresh the page
  5. Click on geist-latin.woff2 to reveal the Request URL: http://localhost:3000/__nextjs_font/geist-latin.woff2

⚠️ Notice how __nextjs_font is loaded from the domain root, and does NOT follow the pattern of _next/* honoring a configured basePath (such as /admin/_next/webpack-hmr or /admin/_next/static/development/_devMiddlewareManifest.json requests). Further, __nextjs_original-stack-frame is another example of consistent handling.

When running locally in a containerized environment with a configured basePath, this inconsistency results in 404 errors for the Geist font, resulting in fallback fonts applied in the Issues Panel.

Expected Behavior

__nextjs_font SHOULD account for basePath, similar to _next/* requests, ensuring 100% consistency for app routing NOT requesting network assets below (read: outside) the configured basePath.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 22.13.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: 10.15.1
Relevant Packages:
  next: 15.5.6 // An outdated version detected (latest is 16.0.0), upgrade is highly recommended!
  eslint-config-next: 15.5.6
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.5.4
Next.js Config:
  output: standalone

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

Error Overlay

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

next dev (local)

Additional context

Upon upgrading from Next.js v14.2.6 to v15.3.1 the error was first encountered.

**

Image

** This error remains active in v15.5.6 up to current canary (v16) release: v16.0.1-canary.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error OverlayRelated to Next.js's error overlay.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions