Deploy failed, and I dont Know what to do

I can not deploy, I have this in deploy Log:

    10:02:11 PM: Build ready to start
10:02:52 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
10:02:52 PM: build-image tag: v3.3.2
10:02:52 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
10:02:52 PM: Fetching cached dependencies
10:02:53 PM: Failed to fetch cache, continuing with build
10:02:53 PM: Starting to prepare the repo for build
10:02:53 PM: No cached dependencies found. Cloning fresh repo
10:02:53 PM: git clone https://github.com/Natcancein/drumMachine
10:02:56 PM: Preparing Git Reference refs/heads/master
10:02:57 PM: Starting build script
10:02:57 PM: Installing dependencies
10:02:58 PM: Downloading and installing node v10.16.0...
10:02:59 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
10:02:59 PM: 
#
10:02:59 PM:   2.7%
10:03:00 PM: 
#################
10:03:00 PM:  24.1%
10:03:00 PM: 
##################################################
10:03:00 PM:                  69.5%
10:03:00 PM: 
################################################
10:03:00 PM: ####################      95.6%
10:03:00 PM: 
######################################################################## 100.0%
10:03:00 PM: Computing checksum with sha256sum
10:03:00 PM: Checksums matched!
10:03:03 PM: Now using node v10.16.0 (npm v6.9.0)
10:03:03 PM: Attempting ruby version 2.6.2, read from environment
10:03:04 PM: Using ruby version 2.6.2
10:03:05 PM: Using PHP version 5.6
10:03:05 PM: Started restoring cached node modules
10:03:05 PM: Finished restoring cached node modules
10:03:05 PM: Installing NPM modules using NPM version 6.9.0
10:03:22 PM: > cwebp-bin@5.0.0 postinstall /opt/build/repo/node_modules/cwebp-bin
10:03:22 PM: > node lib/install.js
10:03:23 PM:   βœ” cwebp pre-build test passed successfully
10:03:23 PM: > gifsicle@4.0.1 postinstall /opt/build/repo/node_modules/gifsicle
10:03:23 PM: > node lib/install.js
10:03:23 PM:   βœ” gifsicle pre-build test passed successfully
10:03:23 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
10:03:23 PM: > node lib/install.js
10:03:24 PM:   βœ” mozjpeg pre-build test passed successfully
10:03:24 PM: > optipng-bin@5.1.0 postinstall /opt/build/repo/node_modules/optipng-bin
10:03:24 PM: > node lib/install.js
10:03:24 PM:   βœ” optipng pre-build test passed successfully
10:03:24 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
10:03:24 PM: > node lib/install.js
10:03:25 PM:   βœ” pngquant pre-build test passed successfully
10:03:25 PM: > styled-components@4.2.0 postinstall /opt/build/repo/node_modules/styled-components
10:03:25 PM: > node ./scripts/postinstall.js || exit 0
10:03:25 PM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
10:03:25 PM: > webpack-cli@3.3.4 postinstall /opt/build/repo/node_modules/webpack-cli
10:03:25 PM: > node ./bin/opencollective.js
10:03:25 PM:                             Thanks for using webpack!
10:03:25 PM:                  Please consider donating to our Open Collective
10:03:25 PM:                         to help us maintain this package.
10:03:25 PM:                  Donate: https://opencollective.com/webpack/donate
10:03:26 PM: npm
10:03:26 PM: WARN drum-machine@1.0.0 No repository field.
10:03:26 PM: npm WARN
10:03:26 PM: optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/fsevents):
10:03:26 PM: npm WARN
10:03:26 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:03:26 PM: added 974 packages from 423 contributors and audited 14469 packages in 20.279s
10:03:26 PM: found 0 vulnerabilities
10:03:27 PM: NPM modules installed
10:03:27 PM: Started restoring cached go cache
10:03:27 PM: Finished restoring cached go cache
10:03:27 PM: unset GOOS;
10:03:27 PM: unset GOARCH;
10:03:27 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
10:03:27 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
10:03:27 PM: go version >&2;
10:03:27 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
10:03:27 PM: go version go1.12 linux/amd64
10:03:27 PM: Installing missing commands
10:03:27 PM: Verify run directory
10:03:27 PM: Executing user command: npm run build
10:03:27 PM: > drum-machine@1.0.0 build /opt/build/repo
10:03:27 PM: > webpack --mode production
10:03:29 PM: Hash: cf8c11de086cd01ef485
10:03:29 PM: Version: webpack 4.30.0
10:03:29 PM: Time: 849ms
10:03:29 PM: Built at: 07/02/2019 2:03:29 AM
10:03:29 PM:  1 asset
10:03:29 PM: Entrypoint main = index_bundle.js
10:03:29 PM: [0] ./src/index.js 3.22 KiB {0} [built] [failed] [1 error]
10:03:29 PM: ERROR in ./src/index.js
10:03:29 PM: Module build failed (from ./node_modules/babel-loader/lib/index.js):
10:03:29 PM: SyntaxError: /opt/build/repo/src/index.js: Unexpected token (5:16)
10:03:29 PM:   3 | import App from './components/App';
10:03:29 PM:   4 |
10:03:29 PM: > 5 | ReactDOM.render(<App />, document.getElementById("root"));
10:03:29 PM:     |                 ^
10:03:29 PM:   6 |
10:03:29 PM:     at Parser.raise (/opt/build/repo/node_modules/@babel/parser/lib/index.js:3851:17)
10:03:29 PM:     at Parser.unexpected (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5167:16)
10:03:29 PM:     at Parser.parseExprAtom (/opt/build/repo/node_modules/@babel/parser/lib/index.js:6328:20)
10:03:29 PM:     at Parser.parseExprSubscripts (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5914:23)
10:03:29 PM:     at Parser.parseMaybeUnary (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5894:21)
10:03:29 PM:     at Parser.parseExprOps (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5781:23)
10:03:29 PM:     at Parser.parseMaybeConditional (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5754:23)
10:03:29 PM:     at Parser.parseMaybeAssign (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5701:21)
10:03:29 PM:     at Parser.parseExprListItem (/opt/build/repo/node_modules/@babel/parser/lib/index.js:6977:18)
10:03:29 PM:     at Parser.parseCallExpressionArguments (/opt/build/repo/node_modules/@babel/parser/lib/index.js:6121:22)
10:03:29 PM:     at Parser.parseSubscript (/opt/build/repo/node_modules/@babel/parser/lib/index.js:6016:29)
10:03:29 PM:     at Parser.parseSubscripts (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5935:19)
10:03:29 PM:     at Parser.parseExprSubscripts (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5924:17)
10:03:29 PM:     at Parser.parseMaybeUnary (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5894:21)
10:03:29 PM:     at Parser.parseExprOps (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5781:23)
10:03:29 PM:     at Parser.parseMaybeConditional (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5754:23)
10:03:29 PM:     at Parser.parseMaybeAssign (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5701:21)
10:03:29 PM:     at Parser.parseExpression (/opt/build/repo/node_modules/@babel/parser/lib/index.js:5649:23)
10:03:29 PM:     at Parser.parseStatementContent (/opt/build/repo/node_modules/@babel/parser/lib/index.js:7420:23)
10:03:29 PM:     at Parser.parseStatement (/opt/build/repo/node_modules/@babel/parser/lib/index.js:7291:17)
10:03:29 PM:     at Parser.parseBlockOrModuleBlockBody (/opt/build/repo/node_modules/@babel/parser/lib/index.js:7868:25)
10:03:29 PM:     at Parser.parseBlockBody (/opt/build/repo/node_modules/@babel/parser/lib/index.js:7855:10)
10:03:29 PM:     at Parser.parseTopLevel (/opt/build/repo/node_modules/@babel/parser/lib/index.js:7220:10)
10:03:29 PM:     at Parser.parse (/opt/build/repo/node_modules/@babel/parser/lib/index.js:8863:17)
10:03:29 PM:     at parse (/opt/build/repo/node_modules/@babel/parser/lib/index.js:11135:38)
10:03:29 PM:     at parser (/opt/build/repo/node_modules/@babel/core/lib/transformation/normalize-file.js:170:34)
10:03:29 PM:     at normalizeFile (/opt/build/repo/node_modules/@babel/core/lib/transformation/normalize-file.js:138:11)
10:03:29 PM:     at runSync (/opt/build/repo/node_modules/@babel/core/lib/transformation/index.js:44:43)
10:03:29 PM:     at runAsync (/opt/build/repo/node_modules/@babel/core/lib/transformation/index.js:35:14)
10:03:29 PM:     at process.nextTick (/opt/build/repo/node_modules/@babel/core/lib/transform.js:34:34)
10:03:29 PM:     at process._tickCallback (internal/process/next_tick.js:61:11)
10:03:29 PM: Child html-webpack-plugin for "index.html":
10:03:29 PM:      1 asset
10:03:29 PM:     Entrypoint undefined = index.html
10:03:29 PM:     [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 509 bytes {0} [built]
10:03:29 PM:     [2] (webpack)/buildin/global.js 472 bytes {0} [built]
10:03:29 PM:     [3] (webpack)/buildin/module.js 497 bytes {0} [built]
10:03:29 PM:         + 1 hidden module
10:03:29 PM: npm
10:03:29 PM:  ERR! code ELIFECYCLE
10:03:29 PM: npm ERR! errno 2
10:03:29 PM: npm ERR!
10:03:29 PM:  drum-machine@1.0.0 build: `webpack --mode production`
10:03:29 PM: npm ERR! Exit status 2
10:03:29 PM: npm ERR!
10:03:29 PM: npm ERR!
10:03:29 PM:  Failed at the drum-machine@1.0.0 build script.
10:03:29 PM: npm
10:03:29 PM:  ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:03:29 PM: npm
10:03:29 PM:  ERR! A complete log of this run can be found in:
10:03:29 PM: npm ERR!
10:03:29 PM:      /opt/buildhome/.npm/_logs/2019-07-02T02_03_29_919Z-debug.log
10:03:29 PM: Skipping functions preparation step: no functions directory set
10:03:29 PM: Caching artifacts
10:03:29 PM: Started saving node modules
10:03:29 PM: Finished saving node modules
10:03:29 PM: Started saving pip cache
10:03:29 PM: Finished saving pip cache
10:03:29 PM: Started saving emacs cask dependencies
10:03:30 PM: Finished saving emacs cask dependencies
10:03:30 PM: Started saving maven dependencies
10:03:30 PM: Finished saving maven dependencies
10:03:30 PM: Started saving boot dependencies
10:03:30 PM: Finished saving boot dependencies
10:03:30 PM: Started saving go dependencies
10:03:30 PM: Finished saving go dependencies
10:03:32 PM: Error running command: Build script returned non-zero exit code: 2
10:03:32 PM: Failing build: Failed to build site
10:03:32 PM: failed during stage 'building site': Build script returned non-zero exit code: 2
10:03:32 PM: Finished processing build request in 40.304423393s

Please, helpme…:pensive:

The first thing to do, before deploying to Netlify is to make sure you can build this on your local environment. At this time, when I checkout your repository using git clone, I get the same error above, when I try to mimic the same process as Netlify’s build bot.

These errors are being caused by your project not having a correct configuration for webpack trying to process the react (jsx) code using babel-loader. To get past this first error add a babel config to your project:

.babelrc

{
  "presets": ["@babel/preset-env", "@babel/preset-react"],
  "plugins": ["@babel/plugin-proposal-class-properties"]
}

Make sure to include the `.babelrc file in your repository.

Note: You should not include your /dist and /node_modules folders into the repository. Netlify will install the dependencies automatically based on your package.json into /node_modules during the setup. /dist will get created on each build using your build command npm run build

.gitignore

dist/
node_modules/
2 Likes

Tony - please let us know if you ever want a job (not kidding). This answer is stellar, thank you!

4 Likes

Thank you! I’ll try what you say,
greetings from Chile!
:ok_hand::+1::raised_hands::raised_hands::raised_hands::raised_hands:

1 Like

I have the same issue today. Locally it works perfect and until yesterday all works perfectly also on netlify. I didn’t any breaking change so what is this?

11:55:21 AM: Build ready to start
11:55:24 AM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
11:55:24 AM: build-image tag: v3.3.2
11:55:24 AM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
11:55:24 AM: Fetching cached dependencies
11:55:24 AM: Starting to download cache of 255.0KB
11:55:24 AM: Finished downloading cache in 72.335466ms
11:55:24 AM: Starting to extract cache
11:55:24 AM: Failed to fetch cache, continuing with build
11:55:24 AM: Starting to prepare the repo for build
11:55:25 AM: No cached dependencies found. Cloning fresh repo
11:55:25 AM: git clone git@bitbucket.org:moze/nineyardscapital-gatsby
11:55:31 AM: Preparing Git Reference refs/heads/master
11:55:32 AM: Found netlify.toml. Overriding site configuration
11:55:32 AM: Starting build script
11:55:32 AM: Installing dependencies
11:55:33 AM: Downloading and installing node v10.16.0...
11:55:33 AM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
11:55:34 AM: 
##
11:55:34 AM:                 3.4%
11:55:34 AM: 
########################################
11:55:34 AM:              55.7%
11:55:34 AM: 
######################################################################## 100.0%
11:55:34 AM: Computing checksum with sha256sum
11:55:34 AM: Checksums matched!
11:55:37 AM: Now using node v10.16.0 (npm v6.9.0)
11:55:38 AM: Attempting ruby version 2.6.2, read from environment
11:55:40 AM: Using ruby version 2.6.2
11:55:40 AM: Using PHP version 5.6
11:55:40 AM: Started restoring cached node modules
11:55:40 AM: Finished restoring cached node modules
11:55:40 AM: Started restoring cached yarn cache
11:55:40 AM: Finished restoring cached yarn cache
11:55:40 AM: Installing yarn at version 1.13.0
11:55:40 AM: Installing Yarn!
11:55:40 AM: > Downloading tarball...
11:55:40 AM: [1/2]: https://yarnpkg.com/downloads/1.13.0/yarn-v1.13.0.tar.gz --> /tmp/yarn.t
11:55:40 AM: ar.gz.MmkIuNNvpJ
11:55:40 AM:   % Total    % Received % Xferd  Average Spee
11:55:40 AM: d   Time    Time     Time  Current
11:55:40 AM: Dload  Upload   Total   Spent    Lef
11:55:40 AM: t  Speed
11:55:40 AM: 
  0     0    0     0    0     0      0      0
11:55:40 AM:  --:--:-- --:--:-- --:--:--     0
11:55:40 AM: 
100    93  100    93    0     0    371      0 --
11:55:40 AM: :--:-- --:--:-- --:--:--   372
11:55:41 AM: 
100   609    0   609    0     0   1016      0 --:--:-- --:--:-- --:--:--  1016
11:55:41 AM: 
  0     0    0     0    0     0
11:55:41 AM:  0      0 --:--:-- --:--:-- --:--:--     0
11:55:41 AM: 1
11:55:41 AM: 0
11:55:41 AM: 0
11:55:41 AM: 1
11:55:41 AM: 1
11:55:41 AM: 4
11:55:41 AM: 2
11:55:41 AM: k
11:55:41 AM: 1
11:55:41 AM: 0
11:55:41 AM: 0
11:55:41 AM: 1
11:55:41 AM: 1
11:55:41 AM: 4
11:55:41 AM: 2
11:55:41 AM: k
11:55:41 AM: 0
11:55:41 AM: 0
11:55:41 AM: 1
11:55:41 AM: 0
11:55:41 AM: 9
11:55:41 AM: 9
11:55:41 AM: k      0  0:00:01  0:00:01 --:--:-
11:55:41 AM: - 5337k
11:55:41 AM: [2/2]: https://yarnpkg.com/downloads/1.13.0/yarn-v1.13.0.tar.gz.asc -->
11:55:41 AM: /tmp/yarn.tar.gz.MmkIuNNvpJ.asc
11:55:41 AM: 
100    97  100    97    0     0   26
11:55:41 AM: 37      0 --:--:-- --:--:-- --:--:--  2637
11:55:41 AM: 1
11:55:41 AM: 0
11:55:41 AM: 0
11:55:41 AM: 6
11:55:41 AM: 1
11:55:41 AM: 3
11:55:41 AM: 0
11:55:41 AM: 6
11:55:41 AM: 1
11:55:41 AM: 3
11:55:41 AM: 0
11:55:41 AM: 0
11:55:41 AM: 3
11:55:41 AM: 3
11:55:41 AM: 5
11:55:41 AM: 9
11:55:41 AM: 0
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: :
11:55:41 AM: -
11:55:41 AM: -
11:55:41 AM: 3
11:55:41 AM: 3
11:55:41 AM: 5
11:55:41 AM: 9
11:55:41 AM: 
100   832  100   832    0     0   3725      0
11:55:41 AM: --:--:-- --:--:-- --:--:--  3725
11:55:41 AM: > Verifying integrity...
11:55:41 AM: gpg: Signature made Tue 18 Dec 2018 04:04:55 PM UTC using RSA key ID B6FF4DE3
11:55:41 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
11:55:41 AM: gpg: Note: This key has expired!
11:55:41 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
11:55:41 AM:      Subkey fingerprint: E219 30C4 D0A4 AA46 1858  1F7A E074 D16E B6FF 4DE3
11:55:41 AM: > GPG signature looks good
11:55:41 AM: > Extracting to ~/.yarn...
11:55:41 AM: > Adding to $PATH...
11:55:41 AM: > We've added the following to your /opt/buildhome/.profile
11:55:41 AM: > If this isn't the profile of your current shell then please add the following to your correct profile:
11:55:41 AM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
11:55:41 AM: 
11:55:42 AM: > Successfully installed Yarn 1.13.0! Please open another terminal where the `yarn` command will now be available.
11:55:43 AM: Installing NPM modules using Yarn version 1.13.0
11:55:43 AM: yarn install v1.13.0
11:55:44 AM: [1/4] Resolving packages...
11:55:47 AM: [2/4] Fetching packages...
11:56:15 AM: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
11:56:15 AM: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
11:56:15 AM: [3/4] Linking dependencies...
11:56:15 AM: warning "gatsby-plugin-favicon > favicons-webpack-plugin@0.0.9" has unmet peer dependency "webpack@^1.13.0 || ^2.0.0 || ^3.0.0 || ^4.0.0".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/eslint-plugin@1.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/parser@1.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "babel-eslint@10.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint@5.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-flowtype@2.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-import@2.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-jsx-a11y@6.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-react@7.x".
11:56:15 AM: warning " > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-react-hooks@1.x".
11:56:27 AM: [4/4] Building fresh packages...
11:56:34 AM: success Saved lockfile.
11:56:34 AM: Done in 50.88s.
11:56:34 AM: NPM modules installed using Yarn
11:56:35 AM: Started restoring cached go cache
11:56:35 AM: Finished restoring cached go cache
11:56:35 AM: unset GOOS;
11:56:35 AM: unset GOARCH;
11:56:35 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
11:56:35 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
11:56:35 AM: go version >&2;
11:56:35 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
11:56:35 AM: go version go1.12 linux/amd64
11:56:35 AM: Installing missing commands
11:56:35 AM: Verify run directory
11:56:35 AM: Executing user command: gatsby build
11:56:38 AM: success open and validate gatsby-configs β€” 0.011 s
11:56:38 AM: success load plugins β€” 0.719 s
11:56:38 AM: success onPreInit β€” 0.007 s
11:56:38 AM: success delete html and css files from previous builds β€” 0.008 s
11:56:38 AM: success initialize cache β€” 0.008 s
11:56:38 AM: success copy gatsby files β€” 0.027 s
11:56:39 AM: success onPreBootstrap β€” 0.013 s
11:56:40 AM:  -> wordpress__acf_options fetched : 1
11:56:40 AM:  -> wordpress__yoast_v1 fetched : 1
11:56:40 AM:  -> wordpress__acf_v3 fetched : 1
11:56:41 AM:  -> wordpress__acf_pages fetched : 6
11:56:42 AM:  -> wordpress__acf_media fetched : 34
11:56:42 AM:  -> wordpress__acf_comments fetched : 0
11:56:42 AM:  -> wordpress__acf_users fetched : 1
11:56:43 AM:  -> wordpress__wp_api_menus_v2 fetched : 1
11:56:44 AM:  -> wordpress__wp_api_menus_menus_items fetched : 1
11:56:44 AM:  -> wordpress__wp_api_menus_menus fetched : 1
11:56:44 AM:  -> wordpress__wp_api_menus_menu_locations fetched : 0
11:56:45 AM:  -> wordpress__wp_v2 fetched : 1
11:56:45 AM:  -> wordpress__PAGE fetched : 6
11:56:46 AM:  -> wordpress__wp_media fetched : 34
11:56:46 AM:  -> wordpress__wp_types fetched : 1
11:56:47 AM:  -> wordpress__wp_statuses fetched : 1
11:56:47 AM:  -> wordpress__wp_users fetched : 1
11:56:47 AM:  -> wordpress__wp_comments fetched : 0
11:56:48 AM:  -> wordpress__wp_search fetched : 6
11:56:49 AM: success source and transform nodes β€” 10.792 s
11:56:50 AM: warning Deprecation warning - adding inferred resolver for field wordpress__PAGEAcfMember.photo. In Gatsby v3, only fields with an explicit directive/extension will get a resolver.
11:56:50 AM: success building schema β€” 0.714 s
11:56:50 AM: success createPages β€” 0.000 s
11:56:50 AM: success createPagesStatefully β€” 0.072 s
11:56:50 AM: success onPreExtractQueries β€” 0.003 s
11:56:50 AM: success update schema β€” 0.030 s
11:56:50 AM: success extract queries from components β€” 0.361 s
11:56:50 AM: success write out requires β€” 0.004 s
11:56:50 AM: success write out redirect data β€” 0.001 s
11:56:50 AM: success onPostBootstrap β€” 0.000 s
11:56:50 AM: info bootstrap finished - 15.543 s
11:56:55 AM: success run static queries β€” 4.041 s β€” 9/9 2.23 queries/second
11:57:22 AM: success Building production JavaScript and CSS bundles β€” 27.946 s
11:57:23 AM: success Rewriting compilation hashes β€” 0.003 s
11:57:23 AM: success run page queries β€” 0.217 s β€” 8/8 37.53 queries/second
11:57:49 AM: success Building static HTML for pages β€” 20.808 s β€” 8/8 9.25 pages/second
11:57:49 AM: info Done building in 73.864 sec
11:57:57 AM: (sharp:1603): GLib-CRITICAL **: 09:57:57.095: g_hash_table_lookup: assertion 'hash_table != NULL' failed
11:57:57 AM: (sharp:1603): GLib-CRITICAL **: 09:57:57.095: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
11:57:57 AM: (sharp:1603): GLib-CRITICAL **: 09:57:57.095: g_hash_table_lookup: assertion 'hash_table != NULL' failed
11:58:01 AM: /usr/local/bin/build: line 34:  1603 Segmentation fault      (core dumped) gatsby build
11:58:01 AM: Skipping functions preparation step: no functions directory set
11:58:01 AM: Caching artifacts
11:58:01 AM: Started saving node modules
11:58:01 AM: Finished saving node modules
11:58:01 AM: Started saving yarn cache
11:58:01 AM: Finished saving yarn cache
11:58:01 AM: Started saving pip cache
11:58:01 AM: Finished saving pip cache
11:58:01 AM: Started saving emacs cask dependencies
11:58:01 AM: Finished saving emacs cask dependencies
11:58:01 AM: Started saving maven dependencies
11:58:01 AM: Finished saving maven dependencies
11:58:01 AM: Started saving boot dependencies
11:58:01 AM: Finished saving boot dependencies
11:58:01 AM: Started saving go dependencies
11:58:01 AM: Finished saving go dependencies
11:58:04 AM: Error running command: Build script returned non-zero exit code: 139
11:58:04 AM: Failing build: Failed to build site
11:58:04 AM: failed during stage 'building site': Build script returned non-zero exit code: 139
11:58:04 AM: Finished processing build request in 2m39.79627947s

It could be the issue here (which is technically a node issue, not a Gatsby issue):

Would you please try the workaround noted there?

That workaround is to add an environment variable: NODE_OPTIONS = "--max_old_space_size=4096"

This is done in Netlify at Site Name > Settings > Build & deploy > Environment.

(Environment variables can also be specified in netlify.toml.)

If this doesn’t work (or even if it does), please let us know.

The workaround should only be used as a temporary solution. Try updating to a newer version of Gatsby before using the workaround.

If the newer version does not fix the issue, let them know if you have a reproducing example, so they can fix it.

@luke @perry Can we move this thread to a new discussion with the appropriate header?

I have the same (randomly) issue, so I just tried to update with last version of gatsby. We’ll see.

G

Hello again @talves , I tried what you answered and I was also guided by a post of how deploy in freecodecamp but I still could not deploy …

This is the Log:
…

10:03:28 PM: npm WARN drum-machine@1.0.0 No repository field.
10:03:28 PM: npm WARN
10:03:28 PM:  optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/fsevents):
10:03:28 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:03:28 PM: added 1009 packages from 423 contributors and audited 14468 packages in 20.659s
10:03:28 PM: found 0 vulnerabilities
10:03:28 PM: NPM modules installed
10:03:28 PM: Started restoring cached go cache
10:03:28 PM: Finished restoring cached go cache
10:03:28 PM: unset GOOS;
10:03:28 PM: unset GOARCH;
10:03:28 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
10:03:28 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
10:03:28 PM: go version >&2;
10:03:28 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
10:03:28 PM: go version go1.12 linux/amd64
10:03:28 PM: Installing missing commands
10:03:28 PM: Verify run directory
10:03:28 PM: Executing user command: npm run build
10:03:29 PM: > drum-machine@1.0.0 build /opt/build/repo
10:03:29 PM: > webpack --mode production
10:03:31 PM: Hash: afbcb6019b5ae2c3b0d9
10:03:31 PM: Version: webpack 4.30.0
10:03:31 PM: Time: 912ms
10:03:31 PM: Built at: 07/10/2019 2:03:31 AM
10:03:31 PM:  1 asset
10:03:31 PM: Entrypoint main = index_bundle.js
10:03:31 PM: [0] ./src/index.js 3.83 KiB {0} [built] [failed] [1 error]
10:03:31 PM: ERROR in ./src/index.js
10:03:31 PM: Module build failed (from ./node_modules/babel-loader/lib/index.js):
10:03:31 PM: SyntaxError: /opt/build/repo/src/index.js: Unexpected token (5:16)
10:03:31 PM:   3 | import App from './components/App';
10:03:31 PM:   4 |
10:03:31 PM: > 5 | ReactDOM.render(<App />, document.getElementById("root"));
10:03:31 PM:     |                 ^
10:03:31 PM:   6 |
10:03:31 PM:     at Parser.raise (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:6344:17)
10:03:31 PM:     at Parser.unexpected (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:7659:16)
10:03:31 PM:     at Parser.parseExprAtom (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8828:20)
10:03:31 PM:     at Parser.parseExprSubscripts (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8413:23)
10:03:31 PM:     at Parser.parseMaybeUnary (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8393:21)
10:03:31 PM:     at Parser.parseExprOps (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8280:23)
10:03:31 PM:     at Parser.parseMaybeConditional (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8253:23)
10:03:31 PM:     at Parser.parseMaybeAssign (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8200:21)
10:03:31 PM:     at Parser.parseExprListItem (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:9475:18)
10:03:31 PM:     at Parser.parseCallExpressionArguments (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8620:22)
10:03:31 PM:     at Parser.parseSubscript (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8515:29)
10:03:31 PM:     at Parser.parseSubscripts (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8434:19)
10:03:31 PM:     at Parser.parseExprSubscripts (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8423:17)
10:03:31 PM:     at Parser.parseMaybeUnary (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8393:21)
10:03:31 PM:     at Parser.parseExprOps (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8280:23)
10:03:31 PM:     at Parser.parseMaybeConditional (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8253:23)
10:03:31 PM:     at Parser.parseMaybeAssign (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8200:21)
10:03:31 PM:     at Parser.parseExpression (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:8148:23)
10:03:31 PM:     at Parser.parseStatementContent (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:9917:23)
10:03:31 PM:     at Parser.parseStatement (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:9788:17)
10:03:31 PM:     at Parser.parseBlockOrModuleBlockBody (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:10364:25)
10:03:31 PM:     at Parser.parseBlockBody (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:10351:10)
10:03:31 PM:     at Parser.parseTopLevel (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:9717:10)
10:03:31 PM:     at Parser.parse (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:11233:17)
10:03:31 PM:     at parse (/opt/build/repo/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:11269:38)
10:03:31 PM:     at parser (/opt/build/repo/node_modules/@babel/core/lib/transformation/normalize-file.js:170:34)
10:03:31 PM:     at normalizeFile (/opt/build/repo/node_modules/@babel/core/lib/transformation/normalize-file.js:138:11)
10:03:31 PM:     at runSync (/opt/build/repo/node_modules/@babel/core/lib/transformation/index.js:44:43)
10:03:31 PM:     at runAsync (/opt/build/repo/node_modules/@babel/core/lib/transformation/index.js:35:14)
10:03:31 PM:     at process.nextTick (/opt/build/repo/node_modules/@babel/core/lib/transform.js:34:34)
10:03:31 PM:     at process._tickCallback (internal/process/next_tick.js:61:11)
10:03:31 PM: Child html-webpack-plugin for "index.html":
10:03:31 PM:      1 asset
10:03:31 PM:     Entrypoint undefined = index.html
10:03:31 PM:     [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 509 bytes {0} [built]
10:03:31 PM:     [2] (webpack)/buildin/global.js 472 bytes {0} [built]
10:03:31 PM:     [3] (webpack)/buildin/module.js 497 bytes {0} [built]
10:03:31 PM:         + 1 hidden module
10:03:31 PM: npm
10:03:31 PM:  ERR! code ELIFECYCLE
10:03:31 PM: npm
10:03:31 PM: ERR! errno
10:03:31 PM:  2
10:03:31 PM: npm
10:03:31 PM: ERR! drum-machine@1.0.0 build: `webpack --mode production`
10:03:31 PM: npm
10:03:31 PM:  ERR! Exit status 2
10:03:31 PM: npm ERR!
10:03:31 PM: npm ERR! Failed at the drum-machine@1.0.0 build script.
10:03:31 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:03:31 PM: npm
10:03:31 PM: ERR!
10:03:31 PM:  A complete log of this run can be found in:
10:03:31 PM: npm ERR!     /opt/buildhome/.npm/_logs/2019-07-10T02_03_31_371Z-debug.log
10:03:31 PM: Skipping functions preparation step: no functions directory set
10:03:31 PM: Caching artifacts
10:03:31 PM: Started saving node modules
10:03:31 PM: Finished saving node modules
10:03:31 PM: Started saving pip cache
10:03:31 PM: Finished saving pip cache
10:03:31 PM: Started saving emacs cask dependencies
10:03:31 PM: Finished saving emacs cask dependencies
10:03:31 PM: Started saving maven dependencies
10:03:31 PM: Finished saving maven dependencies
10:03:31 PM: Started saving boot dependencies
10:03:31 PM: Finished saving boot dependencies
10:03:31 PM: Started saving go dependencies
10:03:31 PM: Finished saving go dependencies
10:03:34 PM: Error running command: Build script returned non-zero exit code: 2
10:03:34 PM: Failing build: Failed to build site
10:03:34 PM: failed during stage 'building site': Build script returned non-zero exit code: 2
10:03:34 PM: Finished processing build request in 41.198999408s

sorry for bothering you again::pensive::pray::pray::pray::pray: …

@Natcancein the .babelrc file is still missing from your repository. Make sure to commit it and git push it into your repository.

1 Like