nextjs - 💡(How to fix) Fix wrapping `nextConfig` with `withMDX` resets `images.remotePatterns` [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#85863Fetched 2026-04-08 02:13:36
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Error Message

  1. The following error will be shown: ⨯ Error: Invalid src prop onnext/image, hostname "utfs.io" is not configured under images in your next.config.js``

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103
  Available memory (MB): 8192
  Available CPU cores: 8
Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: 10.13.1
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: N/A
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/dastanozgeldi/dastanozgeldi.com

To Reproduce

  1. Start the application
  2. Go to /projects page
  3. The following error will be shown: ⨯ Error: Invalid src prop onnext/image, hostname "utfs.io" is not configured under images in your next.config.js``

Current vs. Expected behavior

Before migrating the project to next 16 + next/mdx, the remotePatterns were set and working as expected. I have confirmed that unwrapping nextConfig from withMDX resolved the problem.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103
  Available memory (MB): 8192
  Available CPU cores: 8
Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: 10.13.1
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: N/A
Next.js Config:
  output: N/A

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

Image (next/image)

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

next dev (local)

Additional context

No response

extent analysis

TL;DR

  • Configure the images property in next.config.js to include the hostname "utfs.io" to resolve the next/image error.

Guidance

  • Verify that next.config.js has an images property configured, and add "utfs.io" to the list of allowed hostnames if it's not already included.
  • Check the next/image documentation to ensure that the src prop is being used correctly and that the image URL is valid.
  • Review the changes made during the migration to Next 16 and Next/MDX to identify any potential configuration issues that may have caused the error.

Example

// next.config.js
module.exports = {
  // ... other configurations ...
  images: {
    domains: ['utfs.io'], // add the hostname to the list of allowed domains
  },
}

Notes

  • This solution assumes that the error is caused by a missing configuration in next.config.js. If the issue persists after adding the hostname, further investigation may be needed.
  • The provided environment information and package versions may be relevant to the issue, but without more context, it's difficult to determine their impact.

Recommendation

  • Apply workaround: Configure the images property in next.config.js to include the hostname "utfs.io", as this is the most direct solution to the error message provided.

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 - 💡(How to fix) Fix wrapping `nextConfig` with `withMDX` resets `images.remotePatterns` [1 comments, 2 participants]