Skip to content

turbopack: missing "loader" prop on window using src dir with loaderFile #85726

@H01001000

Description

@H01001000

Link to the code that reproduces this issue

https://github.com/H01001000/reproduction-app

To Reproduce

  1. use src dir
  2. Set images, loader: custom and provide loaderFile (as usual) make sure its in src
  3. Use a Next/Image
  4. run next dev or next build

Current vs. Expected behavior

only trigger on using src dir.

On windows pc, using turbopack (default) will cause the bug, switch to webpack the bug gone
Also tested on macbook m4 pro, turbopack work as expected

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 65447
  Available CPU cores: 32
Binaries:
  Node: 22.13.0
  npm: 9.8.1
  Yarn: 4.4.1
  pnpm: 8.10.5
Relevant Packages:
  next: 16.0.1
  eslint-config-next: 15.1.2
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: standalone

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

Turbopack

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

next dev (local)

Additional context

Tried on next@16, 16.0.1, 16.0.2-canary.5, all will leads to the bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions