Skip to content
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

gatsby-plugin-sharp Incompatible library version #9687

Closed
pedrotavaresgoncalves opened this issue Nov 4, 2018 · 14 comments
Closed

gatsby-plugin-sharp Incompatible library version #9687

pedrotavaresgoncalves opened this issue Nov 4, 2018 · 14 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@pedrotavaresgoncalves
Copy link

Description

When building for local development gatsby-transformer-sharp halts the process

Stack trace:

error Plugin gatsby-transformer-sharp returned an error

Error: dlopen(/Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: @rpath /libvips.42.dylib
Referenced from: /Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/vendor/lib/libvips-cpp.42.dylib
Reason: Incompatible library version: libvips-cpp.dylib requires version 52.0.0 or later, but libvips.42.dylib provides version 51.0.0

Steps to reproduce

gatsby- starter-default download , install gatsby-transformer-sharp , gatsby-plugin-sharp and gatsby-image. With the environment below can't compile.

had to build from source grpc to install sharp (when installing the plugin), or else installation would fail.

Expected result

Should compile in development mode

Actual result

Compilation process breaks

Environment

System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.0.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: 2.0.0 => 2.0.0
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: 3.0.0 => 3.0.0
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: ^2.0.11 => 2.0.11
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: ^2.1.7 => 2.1.7
npmGlobalPackages:
gatsby-cli: 2.4.4

@btk
Copy link
Contributor

btk commented Nov 4, 2018

This is probably duplicate of #9533

You need gatsby 2.0.33 or later. (^2.0.33)

@pedrotavaresgoncalves
Copy link
Author

pedrotavaresgoncalves commented Nov 4, 2018

updated to Gatsby 2.038.

Now I can compile but still get this error:

error Plugin gatsby-transformer-sharp returned an error

Error: dlopen(/Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/build/Release/sharp.node, 1): Li brary not loaded: @rpath/libvips.42.dylib
Referenced from: /Users/pedro/Projects/3Decide/int_alivevision_website/node_modules/gatsby-plugin-sharp/node_modules/sharp/vendor/lib/libvips-cpp.42.d ylib
Reason: Incompatible library version: libvips-cpp.dylib requires version 52.0.0 or later, but libvips.42.dylib provides version 51.0.0

Even though I can compile I assume I won't be able to run gatsby-transformer-sharp with success.

@pedrotavaresgoncalves
Copy link
Author

pedrotavaresgoncalves commented Nov 4, 2018

My gatsby-config.js

module.exports = {
siteMetadata: {
title: 'alive vision',
},
plugins: [
'gatsby-plugin-react-helmet',
{
resolve: gatsby-plugin-manifest,
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
'gatsby-plugin-offline',
gatsby-plugin-sass,
gatsby-transformer-remark,
gatsby-transformer-json,
{
resolve: gatsby-source-filesystem,
options: {
name: src,
path: ${__dirname}/src/,
},
},
{
resolve: gatsby-plugin-typography,
options: {
pathToConfigModule: src/utils/typography.js,
},
},

],
}

@btk
Copy link
Contributor

btk commented Nov 4, 2018

@pedrotavaresgoncalves would you be able to create a repository where you can reproduce this? The other issue looks like it has concluded as this was the problem.

@pedrotavaresgoncalves
Copy link
Author

Only able to solve with these specs.
Got them in gatsby-starter-blog.
Trying with the latest versions of gatsby (2.0.33 and above), gatsby-sharp-plugin and gatsby-transformer-sharp always broke in compilation stage when loading gatsby-transformer-sharp.

System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.0.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: 2.0.19 => 2.0.19
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: 3.0.0 => 3.0.0
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: 2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: 2.1.3 => 2.1.3
npmGlobalPackages:
gatsby-cli: 2.4.4

Had to use npm --build-from-source for installing sharp and firebase in node 11 .

@rexsuit
Copy link

rexsuit commented Nov 4, 2018

Had the same issue. Can confirm that downgrading from gatsby-transformer-sharp: ^2.1.7 to 2.1.4 and gatsby-plugin-sharp: ^2.0.7 to just 2.0.7 fixed the issue for me.

@pedrotavaresgoncalves
Copy link
Author

@btk I don't think this is a duplicate issue, right?

@btk btk added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed type: duplicate labels Nov 6, 2018
@btk
Copy link
Contributor

btk commented Nov 6, 2018

@pedrotavaresgoncalves yeah, I followed your steps, but couldn't work it out. It might be about the environment? Can you reproduce the issue on a repository, and maybe hook it into a CI to see if your problem is about the environment, or a bug in Gatsby is causing this?

@pedrotavaresgoncalves
Copy link
Author

pedrotavaresgoncalves commented Nov 6, 2018

@btk

Here's a repo https://github.com/pedrotavaresgoncalves/gatsby-debug

install instructions:
1)npm install --save firebase --build-from-source
2)npm install --save gatsby@2.0.19
3)npm install --save gatsby-plugin-sharp@2.0.6 --build-from-source
4)npm install --save gatsby-transformer-sharp@2.1.3
5) npm install

I copy pasted from my terminal :)
hope it helps

@pedrotavaresgoncalves
Copy link
Author

Solved the development mode problem but still having trouble to build as you can see in #9707

Maybe node 11 is not yet very safe to use with gatsby v2

@btk
Copy link
Contributor

btk commented Nov 7, 2018

I pulled your test repository, there was no errors thrown. My node version is v8.10.0, it might be bc of that, would you be able to try changing the version of your node and see if it is about the node version?

@pedrotavaresgoncalves
Copy link
Author

Some findings:
Downgrading Node solves npm install issues that forced to use --build-from-source.
Can upgrade Gatsby to latest version and everything works in dev mode.

If upgrade gatsby-plugin-sharp it breaks. Have to stay in 2.0.6

System:
OS: macOS 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 60.0.2
Safari: 12.0
npmPackages:
gatsby: ^2.0.40 => 2.0.40
gatsby-cli: ^2.4.4 => 2.4.4
gatsby-image: ^2.0.19 => 2.0.19
gatsby-plugin-lodash: ^3.0.2 => 3.0.2
gatsby-plugin-manifest: 2.0.2 => 2.0.2
gatsby-plugin-offline: 2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.1 => 3.0.1
gatsby-plugin-sass: 2.0.1 => 2.0.1
gatsby-plugin-sharp: ^2.0.6 => 2.0.6
gatsby-plugin-typography: ^2.2.0 => 2.2.0
gatsby-source-filesystem: 2.0.1 => 2.0.1
gatsby-transformer-json: 2.1.2 => 2.1.2
gatsby-transformer-remark: 2.1.3 => 2.1.3
gatsby-transformer-sharp: ^2.1.3 => 2.1.3
npmGlobalPackages:
gatsby-cli: 2.4.4

Conclusions:

avoid node 11 for now and seems that sharp has a problem with newer versions of gatsby.

@KyleAMathews

@pedrotavaresgoncalves
Copy link
Author

@btk could you give a look at #9707. Maybe you have some ideas :)

@ooloth
Copy link
Contributor

ooloth commented Nov 9, 2018

There's an upstream issue with one of gatsby-plugin-sharp's dependencies on Node 11.

The workaround for now is to delete your node_modules and run npm install --build-from-source.

For details, see: grpc/grpc-node#594 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests

4 participants