Importing next/image into app router middleware logs "attempted import error" only on Linux #54416
Closed
1 task done
Labels
Image (next/image)
Related to Next.js Image Optimization.
locked
Runtime
Related to Node.js or Edge Runtime with Next.js.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Debian 5.10.179-1 (2023-05-12) Binaries: Node: 16.20.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 13.4.20-canary.2 eslint-config-next: 13.4.19 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Image optimization (next/image, next/legacy/image), Middleware / Edge (API routes, runtime), Operating System (Windows, MacOS, Linux)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Syphini/nextjs-middleware-import-bug-repro
To Reproduce
npx create-next-app@latest
(the reproduction template was perfect)middleware.js
file with the following code:npm run dev
Describe the Bug
An unexpected import error is logged to console
In my case, I was incidently importing
next/image
through a third-party package that deeply nested it withinThe bug doesn't appear to have much affect other than logging to console, but it's a bit of a spam on middleware reload
Expected Behavior
Can verify on Windows OS that this error is not logged to the console, and no other issues observed.
It appears to just log this error on Linux (at least on the Debian/Ubuntu versions I have tried)
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: