🐛 BUG: Could not load the "sharp" module using the linux-x64 runtime #7985
Labels
bug
Something that isn't working
regression
Break in existing functionality as a result of a recent change
Which Cloudflare product(s) does this pertain to?
Wrangler
What versions are you using?
3.107.0 [wrangler]
What operating system and version are you using?
Github CI/CD ubuntu-latest
Please provide a link to a minimal reproduction
No response
Describe the Bug
Hey there!
We've just run into an issue with wrangler deployments. With the latest version of wrangler 3.107.0 running wrangler like this:
npx wrangler pages publish dist/ --project-name=xxxxx
Produces this error in our github job:
Error: Could not load the "sharp" module using the linux-x64 runtime
The job is running inside an
actions/setup-node@v4
withnode-version: '19'
Looking at the release of wrangler 3.107.0 it seems like something about the bundling & hoisting of sharp was changed: #7945
Downgrading wrangler to 3.106.0 fixes the issue.
I am not too familiar what exactly the motivation of the change was, but i think it does make sense that wrangler hoists sharp as a dependency, so downstream installations do not need to worry about installing the correct sharp package for the specific platform.
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: