I'm new to Gatsby and Netlify. Haven't really changed anything in configuration. My deploy stop at some point and it's not moving forward. It can take ages. There is no cancel message after 15 minutes. I cannot see any error message.
My local build is ok.
Its working good after 'gatsby build & gatsby serve'
commit to repository ( https://github.com/finewitch/clinicalspace ) then deploy from netlify website
Run gatsby info --clipboard in your project directory and paste the output here.
System:
OS: macOS Sierra 10.12.6
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 74.0.3729.131
Safari: 12.0.3
npmPackages:
gatsby: ^2.11.0 => 2.11.0
gatsby-image: ^2.2.3 => 2.2.3
gatsby-plugin-netlify: ^2.1.0 => 2.1.0
gatsby-plugin-netlify-cms: ^3.0.18 => 3.0.18
gatsby-plugin-purgecss: ^3.1.1 => 3.1.1
gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
gatsby-plugin-sass: ^2.1.0 => 2.1.0
gatsby-plugin-sharp: ^2.2.1 => 2.2.1
gatsby-remark-copy-linked-files: ^2.1.0 => 2.1.0
gatsby-remark-images: ^3.1.2 => 3.1.2
gatsby-remark-relative-images: ^0.2.1 => 0.2.2
gatsby-source-filesystem: ^2.1.1 => 2.1.1
gatsby-transformer-remark: ^2.5.0 => 2.5.0
gatsby-transformer-sharp: ^2.2.0 => 2.2.0
NETLIFY:
4:42:48 PM: Build ready to start
4:42:50 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
4:42:50 PM: build-image tag: v3.3.2
4:42:50 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
4:42:51 PM: Fetching cached dependencies
4:42:51 PM: Starting to download cache of 255.0KB
4:42:51 PM: Finished downloading cache in 71.883466ms
4:42:51 PM: Starting to extract cache
4:42:51 PM: Failed to fetch cache, continuing with build
4:42:51 PM: Starting to prepare the repo for build
4:42:51 PM: No cached dependencies found. Cloning fresh repo
4:42:51 PM: git clone https://github.com/finewitch/clinicalspace
4:42:53 PM: Preparing Git Reference refs/heads/master
4:42:53 PM: Found netlify.toml. Overriding site configuration
4:42:53 PM: Different functions path detected, going to use the one specified in the toml file: 'lambda' versus '' in the site
4:42:53 PM: Creating functions prep folder
4:42:53 PM: Starting build script
4:42:53 PM: Installing dependencies
4:42:55 PM: Downloading and installing node v10.16.0...
4:42:55 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
4:42:56 PM:
##
4:42:56 PM: 3.0%
4:42:56 PM:
############################################
4:42:56 PM: 62.4%
4:42:56 PM:
##########################################################
4:42:56 PM: ######### 94.2%
4:42:56 PM:
######################################
4:42:56 PM: ################################## 100.0%
4:42:56 PM: Computing checksum with sha256sum
4:42:56 PM: Checksums matched!
4:42:59 PM: Now using node v10.16.0 (npm v6.9.0)
4:42:59 PM: Attempting ruby version 2.6.2, read from environment
4:43:01 PM: Using ruby version 2.6.2
4:43:02 PM: Using PHP version 5.6
4:43:02 PM: Started restoring cached node modules
4:43:02 PM: Finished restoring cached node modules
4:43:02 PM: Started restoring cached yarn cache
4:43:02 PM: Finished restoring cached yarn cache
4:43:02 PM: Installing yarn at version 1.9.4
4:43:02 PM: Installing Yarn!
4:43:02 PM: > Downloading tarball...
4:43:02 PM: [1/2]: https://yarnpkg.com/downloads/1.9.4/yarn-v1.9
4:43:02 PM: .4.tar.gz --> /tmp/yarn.tar.gz.CZ9eVJn7Sw
4:43:02 PM: % Tot
4:43:02 PM: al % Received % Xferd Average Speed Time Time
4:43:02 PM: Time Current
4:43:02 PM: Dload Upload Total Spent Left Speed
4:43:02 PM:
0 0 0 0 0 0 0
4:43:02 PM: 0 --:--:-- --:--:-- --:--:-
4:43:02 PM: - 0
4:43:02 PM:
100 91 100 91 0 0 27
4:43:02 PM: 9 0 --:--:-- --:--:-- --:--:-- 280
4:43:03 PM:
100 608 0 608 0 0 722 0 --:--:-- --:--:-- --:--:-- 722
4:43:03 PM:
0 0 0 0 0 0 0 0
4:43:03 PM: --:--:-- --:--:-- --:--:-- 0
4:43:03 PM:
100 915k 100 915k 0 0 721k 0 0
4:43:03 PM: :00:01 0:00:01 --:--:-- 3304k
4:43:03 PM: [2/2]: https://yarnpkg.com/downloads/1.
4:43:03 PM: 9.4/yarn-v1.9.4.tar.gz.asc --> /tmp/yarn.tar.gz.CZ9eVJn7Sw.asc
4:43:03 PM:
100 95 100 95 0 0 2297 0 --:--:-- --:--:-- --:
4:43:03 PM: --:-- 2297
4:43:03 PM:
100 612 0 612 0 0 4267 0 --:--:-- --:--:-- --:--:-- 4267
4:43:03 PM:
100 832 100 832 0 0 4604 0 --:-
4:43:03 PM: -:-- --:--:-- --:--:-- 4604
4:43:03 PM: > Verifying integrity...
4:43:03 PM: gpg: Signature made Fri 03 Aug 2018 07:53:36 PM UTC using RSA key ID B6FF4DE3
4:43:03 PM: gpg: Good signature from "Yarn Packaging <[email protected]>"
4:43:03 PM: gpg: Note: This key has expired!
4:43:03 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907
4:43:03 PM: BBB7 1646 B01B 86E5 0310
4:43:03 PM: Subkey fingerprint: E219 30C4 D0A4 AA46 1858 1F7A E074 D16E B6FF 4DE3
4:43:03 PM: > GPG signature looks good
4:43:03 PM: > Extracting to ~/.yarn...
4:43:03 PM: > Adding to $PATH...
4:43:03 PM: > We've added the following to your /opt/buildhome/.profile
4:43:03 PM: > If this isn't the profile of your current shell then please add the following to your correct profile:
4:43:03 PM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
4:43:03 PM:
4:43:04 PM: > Successfully installed Yarn 1.9.4! Please open another terminal where the `yarn` command will now be available.
4:43:05 PM: Installing NPM modules using Yarn version 1.9.4
4:43:06 PM: yarn install v1.9.4
4:43:06 PM: [1/4] Resolving packages...
4:43:07 PM: warning gatsby > @hapi/[email protected]: This version is no longer maintained
4:43:09 PM: [2/4] Fetching packages...
4:43:09 PM: (node:1371) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
4:43:36 PM: info [email protected]: The platform "linux" is incompatible with this module.
4:43:36 PM: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
4:43:36 PM: [3/4] Linking dependencies...
4:43:36 PM: warning "gatsby > pnp-webpack-plugin > [email protected]" has unmet peer dependency "typescript@*".
4:43:36 PM: warning "gatsby-plugin-netlify > [email protected]" has unmet peer dependency "webpack@>=4.4.0".
4:43:36 PM: warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
4:43:36 PM: warning " > [email protected]" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
4:43:36 PM: warning "netlify-cms > [email protected]" has unmet peer dependency "netlify-cms-lib-util@^2.1.3-beta.0".
4:43:36 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".
4:43:36 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has incorrect peer dependency "slate@^0.32.0".
4:43:36 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has incorrect peer dependency "slate@^0.33.3".
4:43:36 PM: warning "netlify-cms > netlify-cms-app > netlify-cms-widget-markdown > [email protected]" has unmet peer dependency "slate-schema-violations@^0.1.7".
4:43:51 PM: [4/4] Building fresh packages...
4:44:02 PM: success Saved lockfile.
4:44:02 PM: Done in 56.45s.
4:44:02 PM: NPM modules installed using Yarn
4:44:03 PM: Installing Hugo 0.27
4:44:05 PM: Hugo Static Site Generator v0.27 linux/amd64 BuildDate: 2019-06-27T13:44:04Z
4:44:05 PM: Started restoring cached go cache
4:44:05 PM: Finished restoring cached go cache
4:44:05 PM: unset GOOS;
4:44:05 PM: unset GOARCH;
4:44:05 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
4:44:05 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
4:44:05 PM: go version >&2;
4:44:05 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
4:44:05 PM: go version go1.12 linux/amd64
4:44:05 PM: Installing missing commands
4:44:05 PM: Verify run directory
4:44:05 PM: Executing user command: npm run build
4:44:05 PM: > [email protected] build /opt/build/repo
4:44:05 PM: > run-p build:**
4:44:06 PM: > [email protected] build:lambda /opt/build/repo
4:44:06 PM: > netlify-lambda build src/lambda
4:44:06 PM: > [email protected] build:app /opt/build/repo
4:44:06 PM: > npm run clean && gatsby build
4:44:06 PM: > [email protected] clean /opt/build/repo
4:44:06 PM: > rimraf .cache public
4:44:07 PM: netlify-lambda: Building functions
4:44:08 PM: Hash: 2ef9d4d7556e24942a63
4:44:08 PM: Version: webpack 4.29.6
4:44:08 PM: Time: 1380ms
4:44:08 PM: Built at: 06/27/2019 1:44:08 PM
4:44:08 PM: Asset Size Chunks Chunk Names
4:44:08 PM: hello.js 1.19 KiB 0 [emitted] hello
4:44:08 PM: Entrypoint hello = hello.js
4:44:08 PM: [0] ./hello.js 777 bytes {0} [built]
4:44:10 PM: success open and validate gatsby-configs โ 0.025
4:44:11 PM: success load plugins โ 1.121
4:44:11 PM: success onPreInit โ 0.006
4:44:11 PM: success delete html and css files from previous builds โ 0.006
4:44:11 PM: success initialize cache โ 0.011
4:44:11 PM: success copy gatsby files โ 0.038
4:44:11 PM: success onPreBootstrap โ 0.017
4:44:11 PM: success source and transform nodes โ 0.336
4:44:11 PM: success building schema โ 0.399
4:44:12 PM: success createPages โ 0.059
4:44:12 PM: success createPagesStatefully โ 0.062
4:44:12 PM: success onPreExtractQueries โ 0.003
4:44:12 PM: success update schema โ 0.040
4:44:12 PM: success extract queries from components โ 0.315
4:44:12 PM: success write out requires โ 0.005
4:44:12 PM: success write out redirect data โ 0.001
4:44:12 PM: success onPostBootstrap โ 0.000
4:44:12 PM: info bootstrap finished - 5.656 s
4:44:12 PM: success run static queries โ 0.298 โ 2/2 6.73 queries/second
4:44:13 PM: success Generating image thumbnails โ 5/5 - 0.550 s
4:44:21 PM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
4:44:22 PM: gatsby-plugin-purgecss: Only processing /opt/build/repo/src/components/styles.scss
4:44:39 PM: success Building production JavaScript and CSS bundles โ 26.910
4:44:39 PM: success Rewriting compilation hashes โ 0.001
4:44:41 PM: success run page queries โ 1.204 โ 20/20 16.62 queries/second
4:44:43 PM: success Generating image thumbnails โ 38/38 - 2.976 s
4:44:43 PM:
4:44:43 PM: gatsby-plugin-purgecss:
4:44:43 PM: Previous CSS Size: 17.40 KB
4:44:43 PM: New CSS Size: 16.51 KB (-5.13%)
4:44:43 PM: Removed ~0.89 KB of CSS
4:44:43 PM:
4:44:45 PM: success Building static HTML for pages โ 2.446 โ 20/20 54.28 pages/second
4:44:45 PM: info Done building in 38.687 sec
4:44:45 PM: Function Dir: /opt/build/repo/lambda
4:44:45 PM: TempDir: /tmp/zisi-711121018
4:44:46 PM: Prepping functions with zip-it-and-ship-it 0.3.1
4:44:50 PM: [ { path: '/tmp/zisi-711121018/hello.zip', runtime: 'js' },
4:44:50 PM: { path: '/tmp/zisi-711121018/p5.zip', runtime: 'js' },
4:44:50 PM: { path: '/tmp/zisi-711121018/p5.min.zip', runtime: 'js' } ]
4:44:51 PM: Prepping functions complete
4:44:51 PM: Caching artifacts
4:44:51 PM: Started saving node modules
4:44:51 PM: Finished saving node modules
4:44:51 PM: Started saving yarn cache
4:44:51 PM: Finished saving yarn cache
4:44:51 PM: Started saving pip cache
4:44:51 PM: Finished saving pip cache
4:44:51 PM: Started saving emacs cask dependencies
4:44:51 PM: Finished saving emacs cask dependencies
4:44:51 PM: Started saving maven dependencies
4:44:51 PM: Finished saving maven dependencies
4:44:51 PM: Started saving boot dependencies
4:44:51 PM: Finished saving boot dependencies
4:44:51 PM: Started saving go dependencies
4:44:51 PM: Finished saving go dependencies
4:44:54 PM: Build script success
4:44:54 PM: Starting to deploy site from 'public'
4:44:54 PM: Creating deploy tree
4:44:54 PM: 0 new files to upload
4:44:54 PM: 3 new functions to upload
4:45:31 PM: Finished processing build request in 2m40.604997147s
PACKAGE.JSON
{
"name": "gatsby-starter-netlify-cms",
"description": "Example Gatsby, and Netlify CMS project",
"version": "1.1.3",
"author": "Austin Green",
"dependencies": {
"bulma": "^0.7.5",
"gatsby": "^2.11.0",
"gatsby-image": "^2.2.3",
"gatsby-plugin-netlify": "^2.1.0",
"gatsby-plugin-netlify-cms": "^3.0.18",
"gatsby-plugin-purgecss": "^3.1.1",
"gatsby-plugin-react-helmet": "^3.1.0",
"gatsby-plugin-sass": "^2.1.0",
"gatsby-plugin-sharp": "^2.2.1",
"gatsby-remark-copy-linked-files": "^2.1.0",
"gatsby-remark-images": "^3.1.2",
"gatsby-remark-relative-images": "^0.2.1",
"gatsby-source-filesystem": "^2.1.1",
"gatsby-transformer-remark": "^2.5.0",
"gatsby-transformer-sharp": "^2.2.0",
"lodash": "^4.17.5",
"lodash-webpack-plugin": "^0.11.4",
"netlify-cms": "^2.9.4",
"node-sass": "^4.12.0",
"parcel-bundler": "^1.12.3",
"prop-types": "^15.6.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.1",
"uuid": "^3.2.1"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"scripts": {
"clean": "rimraf .cache public",
"start:app": "npm run develop",
"start:lambda": "netlify-lambda serve src/lambda",
"start": "run-p start:**",
"build:app": "npm run clean && gatsby build",
"build:lambda": "netlify-lambda build src/lambda",
"build": "run-p build:**",
"develop": "npm run clean && gatsby develop",
"serve": "gatsby serve",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"http-proxy-middleware": "^0.19.1",
"netlify-lambda": "^1.4.13",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"rimraf": "^2.6.2"
}
}
and netlify.toml
[build]
publish = "public"
command = "npm run build"
functions = "lambda"
[build.environment]
YARN_VERSION = "1.9.4"
YARN_FLAGS = "--no-ignore-optional"

am I missing sth ?
So it looks like you build for both gatsby and the netlify deploy all work. What makes you think it's failing?
Works for me locally, but fails on netlify :(
Hi,
We have the same problem.
Since yesterday afternoon, the deployment of two of our websites hosted on Netlify is very slow (Sometime the build fail). Before that, everything worked completely fine.
We have identified that it needs more than 5 minutes to complete this step :
"[BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/lodash/lodash.js as it exceeds the max of 500KB."
Some times ago, it needed only 2s.
It happens on two different sites, do you think it could be a Netlify issue?
I am having the same issue. It works locally, but fails on build with the same error message:
[BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/netlify-cms/dist/netlify-cms.js as it exceeds the max of 500KB.
I have updated all packages.
System:
OS: macOS 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.3 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 75.0.3770.100
Firefox: 67.0
Safari: 12.1.1
npmPackages:
gatsby: ^2.11.0 => 2.11.0
gatsby-plugin-netlify-cms: ^3.0.18 => 3.0.18
gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
gatsby-plugin-root-import: ^2.0.5 => 2.0.5
gatsby-plugin-sass: ^2.1.0 => 2.1.0
gatsby-plugin-sharp: ^2.2.1 => 2.2.1
gatsby-source-filesystem: ^2.1.1 => 2.1.1
gatsby-transformer-json: ^1.0.20 => 1.0.20
gatsby-transformer-sharp: ^2.2.0 => 2.2.0
npmGlobalPackages:
gatsby-cli: 2.7.3
It then fails on netlify
Hello all, same exact thing is happening to me.
Like above posters, suddenly the past few days netlify and both gatsby build and gatsby develop hangs on this step:
"[BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/lodash/lodash.js as it exceeds the max of 500KB."
โ ง Building production JavaScript and CSS bundles
System:
OS: Linux 4.4 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 11.15.0 - /usr/bin/node
npm: 6.9.1 - /usr/bin/npm
Languages:
Python: 2.7.15 - /usr/bin/python
npmPackages:
gatsby: ^2.10.5 => 2.11.0
gatsby-image: ^2.2.1 => 2.2.3
gatsby-paginate: ^1.1.0 => 1.1.0
gatsby-plugin-breadcrumb: ^2.1.1 => 2.1.2
gatsby-plugin-exclude: ^1.0.0 => 1.0.0
gatsby-plugin-manifest: ^2.2.0 => 2.2.0
gatsby-plugin-netlify: ^2.1.0 => 2.1.0
gatsby-plugin-netlify-cache: ^1.1.0 => 1.2.0
gatsby-plugin-offline: ^2.2.0 => 2.2.0
gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
gatsby-plugin-react-helmet-canonical-urls: ^1.2.0 => 1.2.0
gatsby-plugin-remove-trailing-slashes: ^2.1.0 => 2.1.0
gatsby-plugin-robots-txt: ^1.4.0 => 1.4.0
gatsby-plugin-sharp: ^2.2.1 => 2.2.1
gatsby-plugin-sitemap: ^2.2.0 => 2.2.0
gatsby-plugin-styled-components: ^3.1.0 => 3.1.0
gatsby-plugin-tslint: 0.0.2 => 0.0.2
gatsby-plugin-typescript: ^2.1.0 => 2.1.0
gatsby-plugin-typography: ^2.3.0 => 2.3.0
gatsby-source-filesystem: ^2.1.1 => 2.1.1
gatsby-source-wordpress: ^3.1.1 => 3.1.2
gatsby-transformer-sharp: ^2.2.0 => 2.2.0
npmGlobalPackages:
gatsby-cli: 2.7.3
The build will eventually complete locally however it went from about a 2-3 minute cached build for me with 4000 pages and 4000 some images being transformed to now 20+ minutes.
For instance this step:
success Building production JavaScript and CSS bundles - 453.668 s
takes almost 8 minutes, it used to take 30 seconds. This is local. On netlify this step will take 15+ minutes alone.
Here it is on Netlify:
7:39:54 AM: success Building production JavaScript and CSS bundles โ 1033.833
Netlify on the other hand exhibits the same behavior but just times out when its limit is reached.
Seeing the same behaviour, which coincided with the introduction of this message in the Netlify deploy logs:
The code generator has deoptimised the styling of <x> as it exceeds the max of 500KB.
(in my case <x> is node_modules/lodash/lodash.js)
I can build it locally without issues after setting in package.json
"gatsby-plugin-netlify-cms": "^4.0.3"
So it looks like you build for both gatsby and the netlify deploy all work. What makes you think it's failing?
hey.
The logs part of Netlify stops at 4:45:31 PM: Finished processing build request in 2m40.604997147s
It finished the build but it's not deploying.
Look at the succesful one:

and mine:

Hey all please see #15190 for the Babel errors.
@finewitch ah, thanks I missed that. I'll be an vacation the next week so I won't be able to help from here. Hopefully someone else is able.
Most helpful comment
@finewitch ah, thanks I missed that. I'll be an vacation the next week so I won't be able to help from here. Hopefully someone else is able.