Gatsby: Issue with deploying to Netlify (Sharp plugin and libvips)

Created on 20 Jul 2019  Â·  13Comments  Â·  Source: gatsbyjs/gatsby

Description

Build works fine locally (OSX) but fails when deploying to Netlify.

Expected result

Successful deploy to Netlify

Actual result

This is the build log from the Netlify console.

10:24:06 PM: Build ready to start
10:24:07 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
10:24:07 PM: build-image tag: v2.8.2
10:24:07 PM: buildbot version: b925d11411cabfe7b120501027bd0e96dbc28dde
10:24:07 PM: Fetching cached dependencies
10:24:08 PM: Starting to download cache of 340.6MB
10:24:10 PM: Finished downloading cache in 2.656395246s
10:24:10 PM: Starting to extract cache
10:24:22 PM: Finished extracting cache in 12.187109177s
10:24:22 PM: Finished fetching cache in 15.008308882s
10:24:22 PM: Starting to prepare the repo for build
10:24:23 PM: Preparing Git Reference refs/heads/master
10:24:25 PM: Found netlify.toml. Overriding site configuration
10:24:25 PM: Starting build script
10:24:25 PM: Installing dependencies
10:24:26 PM: Started restoring cached node version
10:24:27 PM: Finished restoring cached node version
10:24:28 PM: v8.16.0 is already installed.
10:24:29 PM: Now using node v8.16.0 (npm v6.4.1)
10:24:29 PM: Attempting ruby version 2.3.6, read from environment
10:24:30 PM: Using ruby version 2.3.6
10:24:30 PM: Using PHP version 5.6
10:24:30 PM: Started restoring cached node modules
10:24:30 PM: Finished restoring cached node modules
10:24:30 PM: Started restoring cached yarn cache
10:24:30 PM: Finished restoring cached yarn cache
10:24:31 PM: Installing NPM modules using Yarn version 1.9.4
10:24:32 PM: yarn install v1.9.4
10:24:32 PM: [1/4] Resolving packages...
10:24:38 PM: [2/4] Fetching packages...
10:25:05 PM: info [email protected]: The platform "linux" is incompatible with this module.
10:25:05 PM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
10:25:05 PM: [3/4] Linking dependencies...
10:25:05 PM: warning "gatsby > pnp-webpack-plugin > [email protected]" has unmet peer dependency "typescript@*".
10:25:05 PM: warning "gatsby-plugin-netlify > [email protected]" has unmet peer dependency "webpack@>=4.4.0".
10:25:05 PM: warning " > [email protected]" has unmet peer dependency "netlify-cms-app@^2.9.0".
10:25:05 PM: warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
10:25:05 PM: warning " > [email protected]" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
10:25:05 PM: warning "netlify-cms > [email protected]" has unmet peer dependency "netlify-cms-lib-util@^2.1.3-beta.0".
10:25:05 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-core > redux-notifications > [email protected]" has incorrect peer dependency "redux@^2.0.0 || ^3.0.0".
10:25:05 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has incorrect peer dependency "slate@^0.32.0".
10:25:05 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has incorrect peer dependency "slate@^0.33.3".
10:25:05 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has unmet peer dependency "slate-schema-violations@^0.1.7".
10:25:43 PM: [4/4] Building fresh packages...
10:26:02 PM: success Saved lockfile.
10:26:02 PM: Done in 90.63s.
10:26:02 PM: NPM modules installed using Yarn
10:26:03 PM: Started restoring cached go cache
10:26:05 PM: Finished restoring cached go cache
10:26:05 PM: Installing Go version 1.10
10:26:05 PM: unset GOOS;
10:26:05 PM: unset GOARCH;
10:26:05 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
10:26:05 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
10:26:05 PM: go version >&2;
10:26:05 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env';
10:26:05 PM: go version go1.10 linux/amd64
10:26:05 PM: Installing missing commands
10:26:05 PM: Verify run directory
10:26:05 PM: Executing user command: npm run build
10:26:05 PM: > [email protected] build /opt/build/repo
10:26:05 PM: > npm run clean && gatsby build
10:26:05 PM: > [email protected] clean /opt/build/repo
10:26:05 PM: > rimraf .cache public
10:26:08 PM: success open and validate gatsby-configs — 0.075
10:26:08 PM: error Found vendored libvips v8.7.0 but require v8.7.4. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'.
10:26:08 PM: Error in "/opt/build/repo/node_modules/gatsby-plugin-sharp/gatsby-node.js": Found vendored libvips v8.7.0 but require v8.7.4. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'.
10:26:08 PM: See our docs page for more info on this error: https://gatsby.dev/issue-how-to
10:26:08 PM: 
10:26:08 PM:   Error: Found vendored libvips v8.7.0 but require v8.7.4. Please remove the 'no  de_modules/sharp/vendor' directory and run 'npm install'.
10:26:08 PM:   
10:26:08 PM:   - libvips.js:55 Object.hasVendoredLibvips
10:26:08 PM:     [repo]/[sharp]/lib/libvips.js:55:11
10:26:08 PM:   
10:26:08 PM:   - constructor.js:9 Object.<anonymous>
10:26:08 PM:     [repo]/[sharp]/lib/constructor.js:9:22
10:26:08 PM:   
10:26:08 PM:   - v8-compile-cache.js:178 Module._compile
10:26:08 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
10:26:08 PM:   
10:26:08 PM:   - v8-compile-cache.js:159 require
10:26:08 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
10:26:08 PM:   
10:26:08 PM:   - index.js:3 Object.<anonymous>
10:26:08 PM:     [repo]/[sharp]/lib/index.js:3:15
10:26:08 PM:   
10:26:08 PM:   - v8-compile-cache.js:178 Module._compile
10:26:08 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
10:26:08 PM:   
10:26:08 PM:   - v8-compile-cache.js:159 require
10:26:08 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
10:26:08 PM:   
10:26:08 PM:   - safe-sharp.js:127 Object.<anonymous>
10:26:08 PM:     [repo]/[gatsby-plugin-sharp]/safe-sharp.js:127:11
10:26:08 PM:   
10:26:08 PM:   - v8-compile-cache.js:178 Module._compile
10:26:08 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
10:26:08 PM:   
10:26:08 PM: 
10:26:08 PM: npm
10:26:08 PM:  ERR! code ELIFECYCLE
10:26:08 PM: npm
10:26:08 PM:  ERR! errno 1
10:26:08 PM: npm
10:26:08 PM: ERR! [email protected] build: `npm run clean && gatsby build`
10:26:08 PM: npm ERR! Exit status 1
10:26:08 PM: npm
10:26:08 PM:  ERR!
10:26:08 PM: npm ERR!
10:26:08 PM:  Failed at the [email protected] build script.
10:26:08 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:26:08 PM: npm
10:26:08 PM: ERR! A complete log of this run can be found in:
10:26:08 PM: npm ERR!     /opt/buildhome/.npm/_logs/2019-07-20T21_26_08_907Z-debug.log
10:26:08 PM: Skipping functions preparation step: no functions directory set
10:26:08 PM: Caching artifacts
10:26:08 PM: Started saving node modules
10:26:08 PM: Finished saving node modules
10:26:08 PM: Started saving yarn cache
10:26:08 PM: Finished saving yarn cache
10:26:08 PM: Started saving pip cache
10:26:08 PM: Finished saving pip cache
10:26:08 PM: Started saving emacs cask dependencies
10:26:09 PM: Finished saving emacs cask dependencies
10:26:09 PM: Started saving maven dependencies
10:26:09 PM: Finished saving maven dependencies
10:26:09 PM: Started saving boot dependencies
10:26:09 PM: Finished saving boot dependencies
10:26:09 PM: Started saving go dependencies
10:26:13 PM: Finished saving go dependencies
10:26:13 PM: Error running command: Build script returned non-zero exit code: 1
10:26:13 PM: Failing build: Failed to build site
10:26:13 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
10:26:13 PM: Finished processing build request in 2m5.499101265s

Environment

This is my local environment which works, not sure how to get the environment in Netlify!

 System:
    OS: macOS 10.14.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
    npm: 6.9.2 - ~/.nvm/versions/node/v10.15.1/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 75.0.3770.142
    Safari: 12.0.3
  npmPackages:
    gatsby: ^2.13.31 => 2.13.31
    gatsby-image: ^2.2.6 => 2.2.6
    gatsby-plugin-google-analytics: ^2.1.4 => 2.1.4
    gatsby-plugin-netlify: ^2.1.3 => 2.1.3
    gatsby-plugin-netlify-cms: ^4.1.6 => 4.1.6
    gatsby-plugin-purgecss: ^3.1.1 => 3.1.1
    gatsby-plugin-react-helmet: ^3.1.2 => 3.1.2
    gatsby-plugin-sass: ^2.1.3 => 2.1.3
    gatsby-plugin-sharp: ^2.2.8 => 2.2.8
    gatsby-plugin-sitemap: ^2.2.3 => 2.2.3
    gatsby-remark-copy-linked-files: ^2.1.3 => 2.1.3
    gatsby-remark-images: ^3.1.6 => 3.1.6
    gatsby-remark-relative-images: ^0.2.2 => 0.2.2
    gatsby-source-filesystem: ^2.1.5 => 2.1.5
    gatsby-transformer-remark: ^2.6.7 => 2.6.7
    gatsby-transformer-sharp: ^2.2.4 => 2.2.4
  npmGlobalPackages:
    gatsby: 2.13.31
awaiting author response

Most helpful comment

For anyone who encounters this problem, I ran yarn upgrade -L --caret and cleared the cache of the deploy on netlify.

https://github.com/alvincrespo/groggy/pull/11

All 13 comments

You'll need to make sure gatsby-plugin-sharp and gatsby-transformer-sharp are updated to the latest version and run a clean netlify buil. So remove cached node_modules and it should work.

Please notify me if this didn't fix your issue.

I have this exact error too. In my case it didn't appear until i upgraded both of those modules.

I've updated both gatsby-plugin-sharp and gatsby-transformer-sharp using yarn upgrade and still have the same error. I also followed the error message's advice and removed sharp then performed an npm install. I also removed the entire node_modules directory.

the package.json versions are as below:

"gatsby-plugin-sharp": "^2.0.5",
"gatsby-transformer-sharp": "^2.1.1",

further to the above, a build will run fine locally, but not on netlify - i suspect its an osx vs linux issue. i've seen posts that refer to this and will test solutions now.

My issue was that netlify was caching the site build. In netlify > deploys > click on trigger > clear cache and deploy site.

This forces everything to get rebuilt. It seems like _libvips_ does not get rebuilt, I find this odd, but there you go.

Deploy cleaning cache in netlify.

Already tried that to no avail :(. The same issue happens. Not entirely sure what's going on!

Did you also delete the sharp vendor folder and do a npm install as the error instructs?

Also does your local site build with "gatsby build"

Still looking into this. Doing "gatsby build" fails but development build works fine. This is what I'm getting now:

gatsby-plugin-purgecss: Only processing  /Users/carlosbeneto/Documents/JS/lonely-lentil-site/src/components/all.sass

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@fortawesome/react-fontawesome/index.es.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/@fortawesome/react-fontawesome/index.es.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@mikaelkristiansson/domready/ready.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/@mikaelkristiansson/domready/ready.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@reach/router/es/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/@reach/router/es/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@reach/router/es/lib/utils.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/@reach/router/es/lib/utils.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby-link/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/gatsby-link/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby-react-router-scroll/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/gatsby-react-router-scroll/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/lodash/lodash.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/lodash/lodash.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/mitt/dist/mitt.es.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/mitt/dist/mitt.es.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/netlify-identity-widget/build/netlify-identity.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/netlify-identity-widget/build/netlify-identity.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/prop-types/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/prop-types/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-add-to-calendar/dist/react-add-to-calendar.min.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react-add-to-calendar/dist/react-add-to-calendar.min.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-dom/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react-dom/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-helmet/lib/Helmet.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react-helmet/lib/Helmet.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-image-gallery/build/image-gallery.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react-image-gallery/build/image-gallery.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-share/es/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react-share/es/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/react/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/shallow-compare/es/index.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")

File: node_modules/shallow-compare/es/index.js


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
    at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)

File: node_modules/react-add-to-calendar/dist/react-add-to-calendar.css


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
    at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)

File: src/components/all.sass


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
    at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)

File: src/components/share.scss


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
    at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)

File: src/templates/gallery.css


 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
    at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)

File: node_modules/react-image-gallery/styles/css/image-gallery.css

â § Building production JavaScript and CSS bundles
error Command failed with exit code 1.

See here:
https://stackoverflow.com/questions/55685466/invalid-option-corejs-is-not-a-valid-top-level-option

Deleting node-modules and reinstalling with npm or yarn may help

Already tried that to no avail. I've also opened a question on Stack Overflow as this is driving me nuts now! I'm sure it's something really straightforward but just not evident to me.

https://stackoverflow.com/questions/57166791/gatsby-failing-production-build

Any idea to resolve this issue? I have the same problem.

https://i.imgur.com/dbklLtF.png

11:09:40 AM: Build ready to start 11:09:41 AM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63 11:09:41 AM: build-image tag: v3.3.2 11:09:41 AM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0 11:09:42 AM: Fetching cached dependencies 11:09:42 AM: Starting to download cache of 255.0KB 11:09:42 AM: Finished downloading cache in 82.718765ms 11:09:42 AM: Starting to extract cache 11:09:42 AM: Failed to fetch cache, continuing with build 11:09:42 AM: Starting to prepare the repo for build 11:09:42 AM: No cached dependencies found. Cloning fresh repo 11:09:42 AM: git clone [email protected]:alvaaz/queenie-s-blog 11:09:47 AM: Preparing Git Reference refs/heads/master 11:09:47 AM: No build command found, continuing to publishing 11:09:48 AM: Starting post processing 11:09:47 AM: Starting to deploy site from '' 11:09:50 AM: Post processing done 11:09:50 AM: Site is live

Seems to have been resolved over at Stack Overflow. Doing the following worked:

- removed yarn.lock and old package-lock.json
- added yarn.lock, removed package-lock.json from .gitignore
- removed node_modules folder
- re-installed dependencies with npm
- run build command with npm

I'm intrigued as to way this is the case though? Shouldn't npm and yarn behave in the same way?

For anyone who encounters this problem, I ran yarn upgrade -L --caret and cleared the cache of the deploy on netlify.

https://github.com/alvincrespo/groggy/pull/11

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  Â·  3Comments

ghost picture ghost  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments

signalwerk picture signalwerk  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments