-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vercel only: 0.33.0: error Could not load the "sharp" module using the linux-x64 runtime #3870
Comments
Do you only see this problem on Vercel? If so, please can you contact their support team. If not, please can you provide answers to the questions in the installation issue template. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@c100k Please open a new installation issue and answer all of the questions. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm pretty sure it's just that the new version has stricter OS/cpu requirements and likely that the installs that's we're used to using aren't adding the correct binaries. Still haven't figured out how to install the correct ones yet though 😵 |
I'm also getting this on my local Linux machine while trying to upgrade
|
Facing same issue on Vercel. I have already install ⨯ Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Add platform-specific dependencies:
npm install --os=linux --cpu=x64 sharp
or
npm install --force @img/sharp-linux-x64
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
at Object.<anonymous> (/var/task/node_modules/sharp/lib/sharp.js:85:9)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at r.<computed>.e._load (/var/task/___vc/__launcher/__launcher.js:14:2299)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at w.require (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:11:25815)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:10:1) {
page: '/api/og'
} update: |
If everything works locally and you're seeing this problem only on Vercel, please contact Vercel support. If you're seeing this problem locally, please open a new installation issue and answer all the questions. This will help me to gather lots of information from as many people as possible before starting to look for patterns. |
I'm having this and I'm not using Vercel. Can it be because of an |
@dresende If you're seeing this problem locally, please open a new installation issue and answer all the questions. This will help me to gather lots of information from as many people as possible before starting to look for patterns. |
FYI it's not just on Vercel, we encountered this issue yesterday (caused an incident in prod) on AWS Lambda using the Node 18 runtime because we install latest (0.33.0 in this case) on every deployment. We fixed it by pinning sharp to 0.32, but didn't investigate further. |
I've renamed this issue so it can focus on those experiencing problems on Vercel only. If you are experiencing it anywhere else, please open a new issue. I genuinely want to help people, and the best way to do that right now is for you to give me lots of information, but not all in the same issue all at once. Lots of separate issues that I can use to find out specifics about each failing environment will allow me to help you to help others. Thank you. |
Vercel uses AWS lambda right? so its probably not to do with Vercel itself but AWS lambda in this case |
In terms of Vercel, my suspicion is that there is something slightly different happening during the remote build that is preventing the right dependencies being installed. Paging @styfle who is always very helpful and may be able to provide more information about Vercel-internal systems for those who are experiencing this problem on Vercel only. |
I am also seeing this error in my tileserver-gl workflow, but I have not had a chance to troubleshoot locally yet. This workflow that fails is Ubuntu 20.04/Node18 One thing I still have to test is the order of sharp/canvas/maplibre-native imports. sometimes the order they are imported seems to make a difference that causes weird errors like this. |
@acalcutt It looks like you've configured npm to not install optional dependencies by using |
Looks like Also related: getsentry/sentry-cli#1849 |
Please use either https://vercel.com/help#issues or https://github.com/orgs/vercel/discussions to report issues directly to Vercel. |
As a quick fix for now you could install an older version of sharp manually in your app. I tried with |
Appreciate for the pointing the right direction. However I just wanna let maintainers and others to know that I suspect this is a Vercel (and its library) issue, not a sharp specific issue. |
After some investigation, if I change https://github.com/lovell/sharp/blob/main/lib/sharp.js#L24 to |
@devunt Great detective work, thank you, it confirms that deployment logic run within Vercel is causing this problem. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm going to temporarily lock this issue as it relates only and specifically to a problem with Vercel that is being tracked at vercel/nft#371 - please subscribe to that issue and/or contact Vercel support for updates. For anyone else coming here, please open a new installation issue and answer all the questions. I need your answers to these questions as a minimum starting point to be able to try to help you. |
The vercel/nft#371 issue has now been fixed. If you are deploying to Vercel (or using Next.js standalone mode) please ensure you upgrade your dependencies to use For anyone else coming here experiencing similar symptoms, please open a new installation issue and answer all the questions. |
This worked for me, I had the same issue with Next.js on Vercel and Netlify. |
I wasn't using @vercel/nft, and its still error in vercel for me using latest versions |
@JClackett I think Vercel uses |
Was also experiencing this issue and updating Node fixed it ( |
Not working for me deployed on render. Using node 18.19.0. Rolling back to 0.32.6 fixed the issue for me |
Same issue on AWS, not vercel. Node 18.17.0 - x64, 0.32.6 rollback works |
There was a problem affecting both Next.js standalone mode and Vercel deployments, which has now been fixed - please ensure Lots of people are running into npm/cli#4828 and the symptoms are similar so please check that one first if you're sharing lockfiles between multiple platforms. If you're still having problems, please open a new installation issue and answer all the questions. I need your answers to these questions as a minimum starting point to be able to try to help you. I'm going to lock this issue again. |
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?What are the steps to reproduce?
Running sharp on Vercel breaks after updating from 0.32.6 to 0.33.0
Downgrading to 0.32.6 for now
The text was updated successfully, but these errors were encountered: