Skip to content

Custom image loader does not work on Windows #86614

@damianfrizzi

Description

@damianfrizzi

Link to the code that reproduces this issue

https://github.com/damianfrizzi/next-windows-image-loader-bug

To Reproduce

  1. bun install
  2. bun run dev
  3. Page crashes with error on Windows

Current vs. Expected behavior

The globally defined custom image loader works on MacOS but not on Windows.
On Windows the following error appears:

\next-windows-image-loader-bug\.next\dev\server\chunks\ssr\node_modules_e6f2a25f._.js: Invalid source map. Only conformant source maps can be used to find the original code. Cause: Error: sourceMapURL could not be parsed
 ⨯ Error: Image with src "https://example.com/someimage.jpg" is missing "loader" prop.
Read more: https://nextjs.org/docs/messages/next-image-missing-loader
    at ignore-listed frames {
  digest: '2389313161'
}

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65014
  Available CPU cores: 14
Binaries:
  Node: 24.11.1
  npm: 11.6.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.0.5 // Latest available version is detected (16.0.5).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Image (next/image)Related to Next.js Image Optimization.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions