Get an error when upgrading to next v15 and icon.svg in the app folder
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/Cache-Hit-Shanghai/pikebaohomepage
To Reproduce
- Download the project from the link above.
- Upgrade next.js to v15.
- npm run dev
Current vs. Expected behavior
current
next-app-loader?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.jsx&appDir=C%3A%5CUsers%5C14S%5CDownloads%5Ccode%5Cpikebaohomepage%5Capp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=C%3A%5CUsers%5C14S%5CDownloads%5Ccode%5Cpikebaohomepage&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!:63
Error: Image import "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!C:\Users\14S\Downloads\code\pikebaohomepage\app\icon.svg?next_metadata" is not a valid image file. The image may be corrupted or an unsupported format.
expected
No error as with next v14.
Provide environment information
Win11
next.js v15
node v23
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction project and reproduce the failure using Next.js v15, then trace handling of app/icon.svg through next-metadata-image-loader during next dev and next build. Done means the project runs without the invalid-image error, matching the reported Next.js v14 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, node.js
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100