Hi there, i'm trying out Gatsby in my personal macOS system. However when running gatsby develop or gatsby build I run into the following error:
success open and validate gatsby-config โ 0.010 s
success load plugins โ 0.491 s
โ Illegal instruction: 4
I was able to drill down the root cause to the gatsby-transformer-sharp which depends on the sharp lib. After a bit of investigation I found this thread which seems to be related to this issue: https://github.com/lovell/sharp/issues/1402
A suggested workaround is this: https://github.com/lovell/sharp/issues/1402#issuecomment-428639785 which I've tried with no success, because I run into a new problem which is being unable to install vips using homebrew:
$ brew install vips --build-from-source
==> Installing dependencies for vips: python@2, gobject-introspection, cmake, rust, libtiff, gdk-pixbuf, libcroco, fribidi, graphite2, harfbuzz, pango, librsvg, little-cms2, orc, webp, gmp, isl, mpfr, libmpc, gcc, fftw, jasper, libtool, graphicsmagick, nspr, nss, openjpeg and poppler
==> Installing vips dependency: python@2
==> Downloading https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
curl: (35) Unknown SSL protocol error in connection to www.python.org:-36
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "python@2"
Download failed: https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
In this case it seems that Python 2.7.15 is no longer supported for OSX El Capitan (no homebrew bottle for this OS): https://formulae.brew.sh/formula/python@2
I'm just posting this to find out if:
gatsby-transformer-sharpvips using homebrew.Appreciate any help that you can provide!
Run gatsby develop in OSX El Capitan, you'll get the aforementioned error;
Commenting gatsby-transformer-sharp in gatsby-config.js and removing Image component from image.js no longer throws the error.
System:
OS: OS X El Capitan 10.11.6
CPU: x64 Intel(R) Core(TM)2 Duo CPU E8135 @ 2.66GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.6.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 46.0
Safari: 11.1.1
npmPackages:
gatsby: ^2.0.19 => 2.0.19
gatsby-image: ^2.0.15 => 2.0.15
gatsby-plugin-manifest: ^2.0.5 => 2.0.5
gatsby-plugin-offline: ^2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0
gatsby-plugin-sharp: ^2.0.8 => 2.0.8
gatsby-plugin-styled-components: ^3.0.0 => 3.0.0
gatsby-source-filesystem: ^2.0.4 => 2.0.4
gatsby-transformer-sharp: ^2.1.4 => 2.1.4
That's a bummer. ๐ Have you tried using an older version of gatsby-transformer-sharp? Its sharp dependency seems to have been updated just recently.
Try npm i [email protected] for a temporary fix while waiting for sharp devs to fix the issue! ๐
@hexrcs for sure I will try that approach, the thing is I'll be away from that setup for the next 2 weeks, so I won't be able to provide feedback until then. If you could keep this issue open for that period it would be highly appreciated. It would also give someone else the chance to chime in, if that's the case.
On a side note: I am aware that this is an issue with my particular setup, so it will probably affect a very very small number of people. I would probably find a workaround if I updated from El Capitan to a most recent version, however that's not an option due to compatibility constraints of other software running in that machine.
On another note: I've tested Gatsby in an Ubuntu environment and everything worked fine (as it was expected :) ).
Thanks for the feedback!
@josebrito This has been fixed upstream - see https://github.com/lovell/sharp/issues/1402#issuecomment-435102575
Awesome. Thanks @lovell for the fix and noting it here, as well ๐
Closing this out, @josebrito feel free to re-open as needed! Thank you!
@DSchau @hexrcs As promised, I'm back to provide some feedback and can confirm that the issue no longer occurs, even in El Capitan.
Thanks guys, hats off to @lovell !
Most helpful comment
@josebrito This has been fixed upstream - see https://github.com/lovell/sharp/issues/1402#issuecomment-435102575