nextjs - ✅(Solved) Fix [Turbopack] Generate icons using code missing basePath config with turbopack [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#87422Fetched 2026-04-08 02:07:03
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×1cross-referenced ×1issue_type_added ×1labeled ×1

Error Message

The error started appearing minimum since nextjs 15.

Fix Action

Fixed

PR fix notes

PR #87478: fix(turbopack): respect basePath when generating metadata icons

Description (problem / solution / changelog)

What?

Fix metadata icon URLs generated with Turbopack to correctly respect basePath.

Why?

When using Turbopack with a configured basePath, metadata icons (favicon, apple icons, etc.) are generated without the basePath prefix, resulting in broken icon URLs. This works correctly with Webpack but fails with Turbopack.

How?

  • Apply basePath to root-relative metadata icon URLs during metadata resolution
  • Skip absolute URLs and prevent double-prefixing
  • Match Webpack behavior without changing public APIs

Fixes #87422

Changed files

  • packages/next/src/lib/metadata/metadata-context.tsx (modified, +5/-2)
  • packages/next/src/lib/metadata/resolve-metadata.ts (modified, +44/-6)
  • packages/next/src/lib/metadata/types/resolvers.ts (modified, +4/-0)

Code Example

Any platform 

The error started appearing minimum since nextjs 15.
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/ntduyfit/icon-missing-basepath

To Reproduce

This issue can be reproduce with dev mode or production build using turbopack

Current vs. Expected behavior

Current: I setup basepath in next.config /fms but when generating application icon, the output is missing basePath cause it is unable to load icon. It is working normally with webpack.

<img width="1410" height="104" alt="Image" src="https://github.com/user-attachments/assets/dbb91f56-6ed7-4569-8b51-97e71750d3cc" /> <img width="421" height="462" alt="Image" src="https://github.com/user-attachments/assets/b9b0ebd0-5ab2-4bed-b641-d9199e49421f" />

Provide environment information

Any platform 

The error started appearing minimum since nextjs 15.

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

Turbopack

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

next dev (local), next start (local), Other (Deployed)

Additional context

I notice this issue happened when I start using Turbopack for development. But for production, I still using Webpack. But starting from version 16, I have try using Turbopack for building production, this issue still happens.

extent analysis

TL;DR

The issue with the missing base path in the application icon when using Turbopack can be addressed by configuring the basepath option correctly for Turbopack.

Guidance

  • Verify that the basepath is properly set in the next.config file and that it is being applied correctly when using Turbopack.
  • Check the Turbopack configuration to ensure that it is compatible with the basepath setup in next.config.
  • Compare the differences in configuration between Webpack and Turbopack to identify any discrepancies that might be causing the issue.
  • Test the application with Turbopack in development mode to see if the issue persists and to gather more information about the problem.

Example

No specific code example can be provided without more details about the next.config and Turbopack configurations.

Notes

The issue seems to be specific to Turbopack and might be related to how it handles the basepath configuration. The fact that it works with Webpack suggests that the issue is not with the next.config setup itself but rather with how Turbopack interprets or applies this configuration.

Recommendation

Apply workaround: Until the issue is fully resolved, consider using Webpack for production builds if possible, as it is reported to work correctly with the basepath setup.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix [Turbopack] Generate icons using code missing basePath config with turbopack [1 pull requests, 1 comments, 2 participants]