You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are you deploying your application? (if relevant)
No response
Describe the Bug
With high aspect ratio images and small height, we can get an error during build while optimising the image:
Error: Expected positive integer for height but received 0 of type number
at Object.invalidParameterError (/app/node_modules/sharp/lib/is.js:124:10)
at Sharp.resize (/app/node_modules/sharp/lib/resize.js:251:16)
at Object.resizeImage (/app/node_modules/next/dist/server/image-optimizer.js:623:21)
at /app/node_modules/next/dist/build/webpack/loaders/next-image-loader.js:63:98
at Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:79:26)
at /app/node_modules/next/dist/build/webpack/loaders/next-image-loader.js:63:60
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9)
In my case it is a 184x8 px image.
Expected Behavior
No error during build.
This is because the shrinked image height for bluring is rounded to 0:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
With high aspect ratio images and small height, we can get an error during build while optimising the image:
In my case it is a 184x8 px image.
Expected Behavior
No error during build.
This is because the shrinked image height for bluring is rounded to 0:
next.js/packages/next/build/webpack/loaders/next-image-loader.js
Lines 38 to 40 in 7556611
Could be fixed with:
Same for the width on next lines.
Link to reproduction
irrelevant
To Reproduce
import a static image with high aspect ratio and low height. The build will fail
The text was updated successfully, but these errors were encountered: