Deployment error after successful deployments

I need advice to debug deploy Netlify App

I get the following error, nothing has changed since last deployment

8:39:51 PM: ​
8:39:51 PM: ┌────────────────────────────────┐
8:39:51 PM: │ 1. Build command from settings │
8:39:51 PM: └────────────────────────────────┘
8:39:51 PM: ​
8:39:51 PM: $ gatsby build
8:39:54 PM:
8:39:54 PM:
8:39:54 PM: success open and validate gatsby-configs - 0.021s
8:39:55 PM:
8:39:55 PM: success load plugins - 0.393s
8:39:55 PM:
8:39:55 PM: success onPreInit - 0.014s
8:39:55 PM:
8:39:55 PM: success delete html and css files from previous builds - 0.013s
8:39:55 PM: success initialize cache - 0.009s
8:39:55 PM:
8:39:55 PM: success copy gatsby files - 0.053s
8:39:55 PM: success onPreBootstrap - 0.008s
8:39:55 PM:
8:39:55 PM: success createSchemaCustomization - 0.003s
8:39:55 PM:
8:39:55 PM: success source and transform nodes - 0.026s
8:39:55 PM:
8:39:55 PM: success building schema - 0.233s
8:39:55 PM: success createPages - 0.020s
8:39:55 PM: success createPagesStatefully - 0.079s
8:39:55 PM:
8:39:55 PM: success onPreExtractQueries - 0.000s
8:39:55 PM:
8:39:55 PM: success update schema - 0.031s
8:39:55 PM:
8:39:55 PM: success extract queries from components - 0.026s
8:39:55 PM:
8:39:55 PM: success write out requires - 0.003s
8:39:55 PM: success write out redirect data - 0.001s
8:39:55 PM:
8:39:55 PM: success Build manifest and related icons - 0.263s
8:39:55 PM:
8:39:55 PM: success onPostBootstrap - 0.264s
8:39:55 PM:
8:39:55 PM: ⠀
8:39:55 PM:
8:39:55 PM: info bootstrap finished - 4.285s
8:39:55 PM:
8:39:55 PM: ⠀
8:40:11 PM:
8:40:11 PM:
8:40:11 PM: failed Building production JavaScript and CSS bundles - 15.059s
8:40:11 PM:
8:40:11 PM:
8:40:11 PM: error Generating JavaScript bundles failed
8:40:11 PM: /opt/build/repo/src/components/Banner.js: Unexpected token (7:1)
8:40:11 PM: 5 |


8:40:11 PM: 6 |
8:40:11 PM: > 7 | <<<<<<< HEAD
8:40:11 PM: | ^
8:40:11 PM: 8 |

Sarah ANDand Dave


8:40:11 PM: 9 | =======
8:40:11 PM: 10 |
8:40:11 PM: ​
8:40:11 PM: ┌─────────────────────────────┐
8:40:11 PM: │ “build.command” failed │
8:40:11 PM: └─────────────────────────────┘
8:40:11 PM: ​
8:40:11 PM: Error message
8:40:11 PM: Command failed with exit code 1: gatsby build
8:40:11 PM: ​
8:40:11 PM: Error location
8:40:11 PM: In Build command from settings:
8:40:11 PM: gatsby build
8:40:11 PM: ​
8:40:11 PM: Resolved config
8:40:11 PM: build:
8:40:11 PM: command: gatsby build
8:40:11 PM: publish: /opt/build/repo/public
8:40:11 PM: Caching artifacts
8:40:11 PM: Started saving node modules
8:40:11 PM: Finished saving node modules
8:40:11 PM: Started saving build plugins
8:40:11 PM: Finished saving build plugins
8:40:11 PM: Started saving pip cache
8:40:11 PM: Finished saving pip cache
8:40:11 PM: Started saving emacs cask dependencies
8:40:11 PM: Finished saving emacs cask dependencies
8:40:11 PM: Started saving maven dependencies
8:40:11 PM: Finished saving maven dependencies
8:40:11 PM: Started saving boot dependencies
8:40:11 PM: Finished saving boot dependencies
8:40:11 PM: Started saving go dependencies
8:40:11 PM: Finished saving go dependencies
8:40:15 PM: Error running command: Build script returned non-zero exit code: 1
8:40:15 PM: Failing build: Failed to build site
8:40:15 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
8:40:15 PM: Finished processing build request in 1m49.827572404s

Hmm, that’s very strange. The error is definitely located in the Banner.js file you have:

Is this coming from a public repo where we can take a look?

Hi, @dave-benson, I do see that this repo is public. I cloned the repo, switch to the same node version as the build (v10.21.0), ran npm install and npm run build. The result was the same:

$ npm run build

> gatsby-starter-forty-v2@1.0.0 build /Users/me/tmp/gatsby-wed-site
> gatsby build

success open and validate gatsby-configs - 0.020s
success load plugins - 2.765s
success onPreInit - 0.015s
success delete html and css files from previous builds - 0.012s
success initialize cache - 0.008s
success copy gatsby files - 0.037s
success onPreBootstrap - 0.009s
success createSchemaCustomization - 0.004s
success source and transform nodes - 0.021s
success building schema - 0.154s
success createPages - 0.010s
success createPagesStatefully - 0.051s
success onPreExtractQueries - 0.001s
success update schema - 0.023s
success extract queries from components - 0.028s
success write out requires - 0.004s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.095s
success onPostBootstrap - 0.100s
⠀
info bootstrap finished - 5.469s
⠀
failed Building production JavaScript and CSS bundles - 6.701s

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

/Users/me/tmp/gatsby-wed-site/src/components/Banner.js: Unexpected token (7:1)

   5 |         <div className="inner">
   6 |             <header className="major">
>  7 | <<<<<<< HEAD
     |  ^
   8 |                 <h1>Sarah ANDand Dave</h1>
   9 | =======
  10 |

File: src/components/Banner.js:7:1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-forty-v2@1.0.0 build: `gatsby build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-forty-v2@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-06-09T02_39_45_489Z-debug.log

So, this isn’t an issue with our build system but something specific to the site code itself. Someone else may be able to assist with this here but our support team does not troubleshoot third-party code. Third-party code isn’t covered in the scope of our support (even for Enterprise teams unless there is a custom support contract to include it).

Again, other people may assist you but our support team must focus on issues which are specific to Netlify. For example, if this built successfully for me (while not working in our build system), then I would troubleshoot what was different in the build system to get it working both places. Also, if you do find a solution for this issue and want to post it here, I’m sure others would find this helpful.