Skip to content

VIPS issue on build (gatsby) #2684

Closed
Closed

Description

@EMedina24

Hello all,

im getting this error when running gatsby develop . I am running the latest version of sharp.

**
ERROR:/Users/runner/work/sharp/sharp/vendor/8.10.5/include/vips/VImage8.h:125:vips::VObject &vips::VObject::operator=(const vips::VObject &): assertion failed: (!a.vobject || VIPS_IS_OBJECT( a.vobject ))
not finished onPostBootstrap - 0.009snot finished Build manifest and related icons - 0.008s
Screen Shot 2021-04-29 at 2 57 45 PM

here are my dependencies

"dependencies": {
"@contentful/gatsby-transformer-contentful-richtext": "^13.1.0",
"@emotion/react": "^11.1.5",
"@fullpage/react-fullpage": "^0.1.19",
"contentful-import": "^7.9.40",
"gatsby": "^3.4.0",
"gatsby-plugin-emotion": "^6.0.0",
"gatsby-plugin-fontawesome-css": "^1.1.0",
"gatsby-plugin-gatsby-cloud": "^2.0.0",
"gatsby-plugin-image": "^1.3.1",
"gatsby-plugin-manifest": "^3.0.0",
"gatsby-plugin-offline": "latest",
"gatsby-plugin-postcss": "^4.0.0",
"gatsby-plugin-react-helmet": "^4.0.0",
"gatsby-plugin-sharp": "~3.3.0",
"gatsby-source-contentful": "^5.0.3",
"gatsby-source-filesystem": "^3.0.0",
"gatsby-source-shopify": "^4.0.0",
"gatsby-theme-shopify-manager": "^0.1.8",
"gatsby-transformer-sharp": "~3.3.0",
"postcss": "^8.2.8",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-helmet": "^6.1.0",
"react-select": "^4.3.0",
"react-slick": "^0.28.1",
"react-tabs": "^3.2.1",
"slick-carousel": "^1.8.1"
},

Activity

  1. lovell commented on Apr 29, 2021

    @lovell
    Owner

    Please can you upgrade gatsby-plugin-sharp, gatsby-transformer-sharp etc. as these are not the latest.

  2. EMedina24 commented on Apr 29, 2021

    @EMedina24
    Author

    Hi,
    just updated both gatsby-plugin-sharp, gatsby-transformer-sharp.

    My co-worker is also having the same issue on his mac OS machine. This issue is non existent on windows

  3. lovell commented on Apr 29, 2021

    @lovell
    Owner

    What is the complete output of running npm install --verbose sharp?

    What is the output of running npx envinfo --binaries --system?

  4. EMedina24 commented on Apr 29, 2021

    @EMedina24
    Author

    npm install -- verbose sharp:
    Screen Shot 2021-04-29 at 3 42 20 PM
    installed just fine.

    npx envinfo --binaries --system:
    Screen Shot 2021-04-29 at 3 43 53 PM

  5. EMedina24 commented on Apr 29, 2021

    @EMedina24
    Author

    complete output :
    `Edgardos-MacBook-Pro:echelon-commercial-gatsby edgardomedina$ npm install --verbose sharp
    npm info it worked if it ends with ok
    npm verb cli [
    npm verb cli '/usr/local/bin/node',
    npm verb cli '/usr/local/bin/npm',
    npm verb cli 'install',
    npm verb cli '--verbose',
    npm verb cli 'sharp'
    npm verb cli ]
    npm info using [email protected]
    npm info using [email protected]
    npm verb npm-session 45a9d751bc6152ac
    npm http fetch GET 304 https://registry.npmjs.org/sharp 589ms (from cache)
    npm timing stage:loadCurrentTree Completed in 1770ms
    npm timing stage:loadIdealTree:cloneCurrentTree Completed in 10ms
    npm timing stage:loadIdealTree:loadShrinkwrap Completed in 868ms
    npm http fetch GET 304 https://registry.npmjs.org/semver 82ms (from cache)
    npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 990ms
    npm timing stage:loadIdealTree Completed in 2090ms
    npm timing stage:generateActionsToTake Completed in 69ms
    npm verb correctMkdir /Users/edgardomedina/.npm/_locks correctMkdir not in flight; initializing
    npm verb lock using /Users/edgardomedina/.npm/_locks/staging-c2fc9479874489fc.lock for /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/.staging
    npm timing action:extract Completed in 36ms
    npm info lifecycle [email protected]preuninstall: [email protected]
    npm info lifecycle [email protected]
    uninstall: [email protected]
    npm verb unbuild rmStuff [email protected] from /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules
    npm info lifecycle [email protected]postuninstall: [email protected]
    npm timing action:unbuild Completed in 3ms
    npm timing action:remove Completed in 32ms
    npm timing action:finalize Completed in 3ms
    npm timing action:refresh-package-json Completed in 14ms
    npm info lifecycle [email protected]
    preinstall: [email protected]
    npm timing action:preinstall Completed in 1ms
    npm info linkStuff [email protected]
    npm timing action:build Completed in 2ms
    npm info lifecycle [email protected]~install: [email protected]

    [email protected] install /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/sharp
    (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

    sharp: Using cached /Users/edgardomedina/.npm/_libvips/libvips-8.10.6-darwin-x64.tar.br
    prebuild-install info begin Prebuild-install version 6.1.2
    prebuild-install info looking for local prebuild @ prebuilds/sharp-v0.28.1-napi-v3-darwin-x64.tar.gz
    prebuild-install info looking for cached prebuild @ /Users/edgardomedina/.npm/_prebuilds/d4139b-sharp-v0.28.1-napi-v3-darwin-x64.tar.gz
    prebuild-install info found cached prebuild
    prebuild-install info unpacking @ /Users/edgardomedina/.npm/_prebuilds/d4139b-sharp-v0.28.1-napi-v3-darwin-x64.tar.gz
    prebuild-install info unpack resolved to /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/sharp/build/Release/sharp.node
    prebuild-install info install Successfully installed prebuilt binary!
    npm verb lifecycle [email protected]install: unsafe-perm in lifecycle true
    npm verb lifecycle [email protected]
    install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/sharp/node_modules/.bin:/Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/opt/homebrew/bin:/opt/homebrew/sbin
    npm verb lifecycle [email protected]install: CWD: /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/sharp
    npm timing action:install Completed in 638ms
    npm info lifecycle [email protected]
    postinstall: [email protected]
    npm timing action:postinstall Completed in 0ms
    npm verb unlock done using /Users/edgardomedina/.npm/_locks/staging-c2fc9479874489fc.lock for /Users/edgardomedina/Desktop/echelon-commercial-gatsby/node_modules/.staging
    npm timing stage:executeActions Completed in 752ms
    npm timing stage:rollbackFailedOptional Completed in 1ms
    npm timing stage:runTopLevelLifecycles Completed in 4915ms
    npm verb saving [ { name: 'sharp', spec: '^0.28.1', save: 'dependencies' } ]
    npm verb shrinkwrap skipping write for package.json because there were no changes.
    npm info lifecycle undefinedpreshrinkwrap: undefined
    npm info lifecycle [email protected]
    shrinkwrap: [email protected]
    npm timing audit submit Completed in 1046ms
    npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1046ms
    npm timing audit body Completed in 0ms
    npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
    npm info lifecycle [email protected]~postshrinkwrap: [email protected]
    npm WARN @contentful/[email protected] requires a peer of gatsby@^2.0.33 but none is installed. You must install peer dependencies yourself.
    npm WARN @contentful/[email protected] requires a peer of react@^16.8.6 but none is installed. You must install peer dependencies yourself.
    npm WARN @contentful/[email protected] requires a peer of react-dom@^16.8.6 but none is installed. You must install peer dependencies yourself.
    npm WARN @tailwindcss/[email protected] requires a peer of tailwindcss@^1.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@^16.9.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of sharp@^0.26.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^3.0.0-next.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^2.19.18 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of gatsby@^2.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@^16.8.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-dom@>=16.6.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of autoprefixer@^10.0.2 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of webpack@^5.1.0 but none is installed. You must install peer dependencies yourself.

    104 packages are looking for funding
    run npm fund for details

    found 1 low severity vulnerability
    run npm audit fix to fix them, or npm audit for details
    npm verb exit [ 0, true ]
    npm timing npm Completed in 5850ms
    npm info ok `

  6. lovell commented on Apr 30, 2021

    @lovell
    Owner

    I spy two different versions of sharp in your screenshot, v0.27.2 and v0.28.1, so there's at least one other gatsby-* dependency that is out of sync or not up to date.

  7. kingluddite commented on May 2, 2021

    @kingluddite

    I am running the latest version of sharp. I can successfully run gatsby develop and gatsby build but when I deploy to netlify if get this error

    build error

    This build was working in March but in April it broke.

  8. lovell commented on May 2, 2021

    @lovell
    Owner

    @kingluddite That looks like sharp v0.23.x, which won't support Node.js 15, so please upgrade. If you're still having problems please open a new installation issue.

  9. kingluddite commented on May 2, 2021

    @kingluddite

    @lovell That did the job.

    For others reading this...

    I used $ npm outdated to make sure all my plugins were up to date. I then "thoroughly" read the documentation on gatsby sharp and found that several packages are dependent on sharp so they must all be updated.

    There was still an issue so I use $ npm list sharp and found

    sharp plugin versions

    And one plugin (which I wasn't even using - favicon-webpack-plugin) was using the breaking version of sharp 0.23.4. So I removed that and ran my build again on Netlify and FINALLY, FINALLY had a successful build.

    successful build

    Only took 8 hours of my life to figure this out. Wouldn't have been able to do it without your tip @lovell Many thanks!!

  10. kingluddite commented on May 2, 2021

    @kingluddite
  11. lovell commented on May 16, 2021

    @lovell
    Owner

    I hope this information helped. Please feel free to re-open with more details if further assistance is required.

  12. 4dambarr commented on May 23, 2021

    @4dambarr

    I was having this issue on mac, after upgrading all my packages to the latest version and reinstalling as many things as I could I was close to doing a factory reset on my computer.

    Turns out that in my dependencies gatsby-plugin-manifest uses sharp v0.27.2 but gatsby-plugin-sharp and gatsby-transformer-sharp used sharp v0.28.1, sharp wasn't actually in my package-lock.json, I installed sharp v0.27.2 and was finally able to use run gatsby develop locally, there are still some issues with the packages (probably unrelated to this), but it runs.

    Thanks for reporting and posting the solution.

  13. odyslam commented on Sep 30, 2021

    @odyslam

    @4dambarr hey, I am having the same issue and use the same set of plugins.

    Not entirely sure how you solved it based from your reply. Can you elaborate please?

  14. 4dambarr commented on Sep 30, 2021

    @4dambarr

    @odyslam the issue was that I never installed the sharp package, but had multiple packages that had is as a dependency and these packages used different versions of the sharp package. By installing sharp as a dependency of the project I was able to set a global version and these other packages could just install the version they needed seperately.

  15. odyslam commented on Oct 1, 2021

    @odyslam

    Hey @4dambarr , thanks for the response.

    In my case, it was the gatsby-manifest plugin depending on the broken version of sharp. As soon as I removed the plugin (and thus the dependency), the issue was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions