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
I am also able to reproduce this. The following docker container that sets up a sharp test script fails to build using ncc. The build hangs without exiting.
FROM node:lts-bullseye as builder
# create a package.json
RUN echo'{"name":"ncc-test","version":"1.0.0","description":"test for ncc + sharp bundling issue","main":"index.js","license":"MIT","scripts":{"start":"node dist/index.js","build":"ncc --debug build index.js"},"devDependencies":{"@vercel/ncc":"0.38.3"},"dependencies":{"sharp":"0.34.1"}}'> package.json
RUN echo'const sharp=require("sharp");sharp({create:{width:300,height:200,channels:4,background:{r:255,g:255,b:255,alpha:.5}}}).png().toFile("empty_image.png",(a,e)=>{a&&process.exit(1)})'> index.js
RUN npm i
RUN npm run build
FROM node:lts-bullseye as runner
COPY --from=builder /dist/index.js /dist/index.js
CMD ["node", "/dist/index.js"]
Activity
jlarmstrongiv commentedon Jan 4, 2024
Related CI failures #1151
downgraded sharp because ncc wrongly packages the latest version
yasiruk commentedon Apr 9, 2025
I am also able to reproduce this. The following docker container that sets up a sharp test script fails to build using ncc. The build hangs without exiting.
styfle commentedon Apr 9, 2025
The root cause is likely in https://github.com/vercel/webpack-asset-relocator-loader if anyone wants to submit a PR there
fix: support the packaging format of sharp v0.34.x (vercel#199)