Posts not updated when created via Netlify CMS - reactjs

I've created a new post through Netlify CMS however the posts are not updating on the Gatsby site. I thoroughly followed the add Netlify CMS to existing sites documentation and everything seems to be working fine except the posts is not showing up on my site.
Here are the links to my site with repo and the config.yml file:
My site: https://my-blogger.netlify.app/
My repo: https://github.com/mohammedasker/blogger
config.yml
backend:
name: git-gateway
branch: master
media_folder: "static/media"
public_folder: "/media"
collections:
- name: "blog"
label: "Blog"
folder: "src/content"
create: true
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields:
- { label: "Layout", name: "layout", widget: "hidden", default: "blog" }
- { label: "Title", name: "title", widget: "string" }
- { label: "Slug", name: "slug", widget: "string" }
- { label: "Draft", name: "draft", widget: "boolean", default: true }
- { label: "Description", name: "description", widget: "text" }
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Body", name: "body", widget: "markdown" }
Additional information
I've noticed in the deploy details that the path value is null in "gatsby-node.js" and this might prevent the post from being updated. That being said, the problem continues to persist when the deploy was all green.
Build log:
8:26:23 PM: Build ready to start
8:26:25 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
8:26:25 PM: build-image tag: v3.3.20
8:26:25 PM: buildbot version: be8ecf2af866e16fa4301cc5c14de2ccbbb21cf4
8:26:25 PM: Fetching cached dependencies
8:26:25 PM: Starting to download cache of 139.0MB
8:26:26 PM: Finished downloading cache in 725.651881ms
8:26:26 PM: Starting to extract cache
8:26:32 PM: Finished extracting cache in 6.022644176s
8:26:32 PM: Finished fetching cache in 6.792240623s
8:26:32 PM: Starting to prepare the repo for build
8:26:32 PM: Preparing Git Reference refs/heads/master
8:26:33 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
8:26:33 PM: Starting build script
8:26:34 PM: Installing dependencies
8:26:34 PM: Python version set to 2.7
8:26:34 PM: Started restoring cached node version
8:26:36 PM: Finished restoring cached node version
8:26:37 PM: v12.18.0 is already installed.
8:26:38 PM: Now using node v12.18.0 (npm v6.14.4)
8:26:38 PM: Started restoring cached build plugins
8:26:38 PM: Finished restoring cached build plugins
8:26:38 PM: Attempting ruby version 2.7.1, read from environment
8:26:39 PM: Using ruby version 2.7.1
8:26:39 PM: Using PHP version 5.6
8:26:39 PM: 5.2 is already installed.
8:26:39 PM: Using Swift version 5.2
8:26:39 PM: Started restoring cached node modules
8:26:39 PM: Finished restoring cached node modules
8:26:39 PM: Started restoring cached yarn cache
8:26:39 PM: Finished restoring cached yarn cache
8:26:40 PM: Installing NPM modules using Yarn version 1.22.4
8:26:40 PM: yarn install v1.22.4
8:26:40 PM: [1/4] Resolving packages...
8:26:41 PM: success Already up-to-date.
8:26:41 PM: Done in 0.84s.
8:26:41 PM: NPM modules installed using Yarn
8:26:41 PM: Started restoring cached go cache
8:26:41 PM: Finished restoring cached go cache
8:26:41 PM: go version go1.14.4 linux/amd64
8:26:41 PM: go version go1.14.4 linux/amd64
8:26:41 PM: Installing missing commands
8:26:41 PM: Verify run directory
8:26:42 PM: ​
8:26:42 PM: ┌─────────────────────────────┐
8:26:42 PM: │ Netlify Build │
8:26:42 PM: └─────────────────────────────┘
8:26:42 PM: ​
8:26:42 PM: ❯ Version
8:26:42 PM: #netlify/build 3.0.1
8:26:42 PM: ​
8:26:42 PM: ❯ Flags
8:26:42 PM: deployId: 5f25a5bfbf80940007d20ec6
8:26:42 PM: mode: buildbot
8:26:42 PM: ​
8:26:42 PM: ❯ Current directory
8:26:42 PM: /opt/build/repo
8:26:42 PM: ​
8:26:42 PM: ❯ Config file
8:26:42 PM: No config file was defined: using default values.
8:26:42 PM: ​
8:26:42 PM: ❯ Context
8:26:42 PM: production
8:26:42 PM: ​
8:26:42 PM: ┌───────────────────────────────────┐
8:26:42 PM: │ 1. Build command from Netlify app │
8:26:42 PM: └───────────────────────────────────┘
8:26:42 PM: ​
8:26:42 PM: $ gatsby build
8:26:45 PM: success open and validate gatsby-configs - 0.025s
8:26:46 PM: success load plugins - 0.796s
8:26:46 PM: success onPreInit - 0.009s
8:26:46 PM: success delete html and css files from previous builds - 0.012s
8:26:46 PM: success initialize cache - 0.006s
8:26:46 PM: success copy gatsby files - 0.032s
8:26:46 PM: success onPreBootstrap - 0.007s
8:26:46 PM: success createSchemaCustomization - 0.058s
8:26:46 PM: success Checking for changed pages - 0.000s
8:26:46 PM: success source and transform nodes - 0.145s
8:26:46 PM: success building schema - 0.359s
8:26:46 PM: error Your site's "gatsby-node.js" must set the page path when creating a page.
8:26:46 PM: The page object passed to createPage:
8:26:46 PM: {
8:26:46 PM: "path": null,
8:26:46 PM: "component": "/opt/build/repo/src/templates/blog-post.js",
8:26:46 PM: "slug": "/2020-07-30-you-should-join-the-100daysofcode-challenge/",
8:26:46 PM: "context": {}
8:26:46 PM: }
8:26:46 PM: See the documentation for the "createPage" action — https://www.gatsbyjs.org/docs/actions/#createPage
8:26:46 PM: not finished createPages - 0.020s
8:26:47 PM: ​
8:26:47 PM: ┌─────────────────────────────┐
8:26:47 PM: │ "build.command" failed │
8:26:47 PM: └─────────────────────────────┘
8:26:47 PM: ​
8:26:47 PM: Error message
8:26:47 PM: Command failed with exit code 1: gatsby build
8:26:47 PM: ​
8:26:47 PM: Error location
8:26:47 PM: In Build command from Netlify app:
8:26:47 PM: gatsby build
8:26:47 PM: ​
8:26:47 PM: Resolved config
8:26:47 PM: build:
8:26:47 PM: command: gatsby build
8:26:47 PM: commandOrigin: ui
8:26:47 PM: publish: /opt/build/repo/public
8:26:47 PM: Caching artifacts
8:26:47 PM: Started saving node modules
8:26:47 PM: Finished saving node modules
8:26:47 PM: Started saving build plugins
8:26:47 PM: Finished saving build plugins
8:26:47 PM: Started saving yarn cache
8:26:47 PM: Finished saving yarn cache
8:26:47 PM: Started saving pip cache
8:26:47 PM: Finished saving pip cache
8:26:47 PM: Started saving emacs cask dependencies
8:26:47 PM: Finished saving emacs cask dependencies
8:26:47 PM: Started saving maven dependencies
8:26:47 PM: Finished saving maven dependencies
8:26:47 PM: Started saving boot dependencies
8:26:47 PM: Finished saving boot dependencies
8:26:47 PM: Started saving go dependencies
8:26:47 PM: Finished saving go dependencies
8:26:47 PM: Error running command: Build script returned non-zero exit code: 1
8:26:47 PM: Failing build: Failed to build site
8:26:47 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
8:26:47 PM: Finished processing build request in 22.237427248s
Updated: Added "gatsby-node.js" file
const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)
exports.onCreateNode = ({ node, getNode, actions }) => {
const { createNodeField } = actions
if (node.internal.type === `MarkdownRemark`) {
const slug = createFilePath({ node, getNode, basePath: `pages` })
createNodeField({
node,
name: `slug`,
value: slug,
})
}
}
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)
return graphql(`
{
allMarkdownRemark {
edges {
node {
frontmatter {
path
draft
date
}
fields {
slug
}
}
}
}
}
`).then(result => {
if (result.errors) {
return Promise.reject(result.errors)
}
result.data.allMarkdownRemark.edges
.filter(({ node }) => !node.frontmatter.draft)
.forEach(({ node }) => {
createPage({
path: node.frontmatter.path,
component: blogPostTemplate,
slug: node.fields.slug,
context: {},
})
})
})
}

You have to re-build to update contents, since Gatsby is a static site generator.
After only build, you could check updates because Gatsby fetch updated datas from Netlify CMS when you build.
But you can implement real-time update with Netlify CMS, you need to add markdown pages.
https://www.gatsbyjs.org/docs/sourcing-from-netlify-cms

Related

Issues deploying a React app on Netlify Command failed with exit code 127: build (https://ntl.fyi/exit-code-127)

I was trying to deploy a react app using Netlify but I am encountering some issues.
See below the errors in deployment phase:
12:02:58 PM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
12:02:58 PM: build-image tag: v4.14.3
12:02:58 PM: buildbot version: bd7961a85189b0e0340a6a33e02f396d2d9c7afa
12:02:58 PM: Fetching cached dependencies
12:02:58 PM: Failed to fetch cache, continuing with build
12:02:58 PM: Starting to prepare the repo for build
12:02:58 PM: No cached dependencies found. Cloning fresh repo
12:02:58 PM: git clone https://github.com/SimoGhilo/Reddit_Clone
12:02:59 PM: Preparing Git Reference refs/heads/Main
12:02:59 PM: Parsing package.json dependencies
12:03:00 PM: Starting build script
12:03:00 PM: Installing dependencies
12:03:00 PM: Python version set to 2.7
12:03:01 PM: v16.18.0 is already installed.
12:03:01 PM: Now using node v16.18.0 (npm v8.19.2)
12:03:01 PM: Enabling node corepack
12:03:01 PM: Started restoring cached build plugins
12:03:01 PM: Finished restoring cached build plugins
12:03:01 PM: Attempting ruby version 2.7.2, read from environment
12:03:02 PM: Using ruby version 2.7.2
12:03:02 PM: Using PHP version 8.0
12:03:02 PM: No npm workspaces detected
12:03:02 PM: Started restoring cached node modules
12:03:02 PM: Finished restoring cached node modules
12:03:02 PM: Installing NPM modules using NPM version 8.19.2
12:03:07 PM: npm WARN deprecated stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
12:03:09 PM: npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
12:03:14 PM: added 1462 packages, and audited 1463 packages in 12s
12:03:14 PM: 209 packages are looking for funding
12:03:14 PM: run `npm fund` for details
12:03:14 PM: 8 high severity vulnerabilities
12:03:14 PM: To address issues that do not require attention, run:
12:03:14 PM: npm audit fix
12:03:14 PM: To address all issues (including breaking changes), run:
12:03:14 PM: npm audit fix --force
12:03:14 PM: Run `npm audit` for details.
12:03:14 PM: NPM modules installed
12:03:14 PM: Creating package sha
12:03:14 PM: Started restoring cached go cache
12:03:14 PM: Finished restoring cached go cache
12:03:14 PM: Installing Go version 1.17 (requested 1.17)
12:03:18 PM: unset GOOS;
12:03:18 PM: unset GOARCH;
12:03:18 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
12:03:18 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
12:03:18 PM: go version >&2;
12:03:18 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
12:03:18 PM: go version go1.17 linux/amd64
12:03:19 PM: Detected the following frameworks and their versions:
12:03:19 PM: "create-react-app" at version "5.0.1"
12:03:19 PM: Installing missing commands
12:03:19 PM: Verify run directory
12:03:20 PM: ​
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:20 PM: Netlify Build
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:20 PM: ​
12:03:20 PM: ❯ Version
12:03:20 PM: #netlify/build 28.1.6
12:03:20 PM: ​
12:03:20 PM: ❯ Flags
12:03:20 PM: baseRelDir: true
12:03:20 PM: buildId: 63625c70591ae7067c7e852e
12:03:20 PM: deployId: 63625c70591ae7067c7e8530
12:03:20 PM: ​
12:03:20 PM: ❯ Current directory
12:03:20 PM: /opt/build/repo
12:03:20 PM: ​
12:03:20 PM: ❯ Config file
12:03:20 PM: No config file was defined: using default values.
12:03:20 PM: ​
12:03:20 PM: ❯ Context
12:03:20 PM: production
12:03:20 PM: ​
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:20 PM: 1. Build command from Netlify app
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:20 PM: ​
12:03:20 PM: $ build
12:03:21 PM: Creating deploy upload records
12:03:20 PM: bash: build: command not found
12:03:20 PM: ​
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:20 PM: "build.command" failed
12:03:20 PM: ────────────────────────────────────────────────────────────────
12:03:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:03:20 PM: ​
12:03:20 PM: Error message
12:03:20 PM: Command failed with exit code 127: build (https://ntl.fyi/exit-code-127)
12:03:20 PM: ​
12:03:20 PM: Error location
12:03:20 PM: In Build command from Netlify app:
12:03:20 PM: build
12:03:20 PM: ​
12:03:20 PM: Resolved config
12:03:20 PM: build:
12:03:20 PM: command: build
12:03:20 PM: commandOrigin: ui
12:03:20 PM: environment:
12:03:20 PM: - CI
12:03:20 PM: publish: /opt/build/repo
12:03:20 PM: publishOrigin: default
12:03:20 PM: Caching artifacts
12:03:20 PM: Started saving node modules
12:03:20 PM: Finished saving node modules
12:03:20 PM: Started saving build plugins
12:03:20 PM: Finished saving build plugins
12:03:20 PM: Started saving pip cache
12:03:20 PM: Finished saving pip cache
12:03:20 PM: Started saving emacs cask dependencies
12:03:21 PM: Finished saving emacs cask dependencies
12:03:21 PM: Started saving maven dependencies
12:03:21 PM: Finished saving maven dependencies
12:03:21 PM: Started saving boot dependencies
12:03:21 PM: Finished saving boot dependencies
12:03:21 PM: Started saving rust rustup cache
12:03:21 PM: Finished saving rust rustup cache
12:03:21 PM: Started saving go dependencies
12:03:21 PM: Finished saving go dependencies
12:03:21 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:03:21 PM: Failing build: Failed to build site
12:03:21 PM: Finished processing build request in 23.43614482s
Also see my package.json:
{
"name": "reddit_project",
"version": "0.1.0",
"private": true,
"dependencies": {
"#reduxjs/toolkit": "^1.8.6",
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^13.4.0",
"#testing-library/user-event": "^14.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.4",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"redux": "^4.2.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "CI= npm run build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
And below are my environment variables:
Please note that the value covered is false.
I Have researched and tried different things, I changed my package.json then tweaked my setting but all seems to not produce any result.
What am i doing wrong ?
Thank you for your help.

WebpackError: TypeError: merge is not a function (from plugin: gatsby-plugin-react-helmet)

My Gatsby blog is deployed on Netlify. Everything was working fine, until yesterday when the deployment failed for the following reason:
WebpackError: TypeError: merge is not a function (from plugin: gatsby-plugin-react-helmet)
The complete deploy log is shown below:
11:26:10 PM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
11:26:10 PM: build-image tag: v4.14.3
11:26:10 PM: buildbot version: be0925a1b4e8f8d2c5a767f3e0decf8856cad273
11:26:11 PM: Fetching cached dependencies
11:26:11 PM: Failed to fetch cache, continuing with build
11:26:11 PM: Starting to prepare the repo for build
11:26:11 PM: No cached dependencies found. Cloning fresh repo
11:26:11 PM: git clone https://github.com/sundaray/hemanta.io
11:26:12 PM: Preparing Git Reference refs/heads/master
11:26:13 PM: Parsing package.json dependencies
11:26:14 PM: Starting build script
11:26:14 PM: Installing dependencies
11:26:14 PM: Python version set to 2.7
11:26:14 PM: Downloading and installing node v12.18.0...
11:26:14 PM: Downloading https://nodejs.org/dist/v12.18.0/node-v12.18.0-linux-x64.tar.xz...
11:26:15 PM: Computing checksum with sha256sum
11:26:15 PM: Checksums matched!
11:26:16 PM: Now using node v12.18.0 (npm v6.14.4)
11:26:16 PM: Started restoring cached build plugins
11:26:16 PM: Finished restoring cached build plugins
11:26:16 PM: Attempting ruby version 2.7.1, read from environment
11:26:16 PM: Required ruby-2.7.1 is not installed - installing.
11:26:17 PM: Searching for binary rubies, this might take some time.
11:26:17 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.7.1.tar.bz2
11:26:17 PM: Checking requirements for ubuntu.
11:26:17 PM: Requirements installation successful.
11:26:17 PM: ruby-2.7.1 - #configure
11:26:17 PM: ruby-2.7.1 - #download
11:26:17 PM: ruby-2.7.1 - #validate archive
11:26:20 PM: ruby-2.7.1 - #extract
11:26:22 PM: ruby-2.7.1 - #validate binary
11:26:22 PM: ruby-2.7.1 - #setup
11:26:23 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1#global
11:26:23 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
11:26:23 PM: ruby-2.7.1 - #generating global wrappers........
11:26:23 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
11:26:23 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
11:26:23 PM: ruby-2.7.1 - #generating default wrappers........
11:26:23 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
11:26:24 PM: Using ruby version 2.7.1
11:26:24 PM: Using PHP version 8.0
11:26:24 PM: No npm workspaces detected
11:26:24 PM: Started restoring cached node modules
11:26:24 PM: Finished restoring cached node modules
11:26:24 PM: Installing NPM modules using NPM version 6.14.4
11:26:29 PM: npm WARN deprecated multer#1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
11:26:29 PM: npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
11:26:30 PM: npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
11:26:34 PM: npm WARN deprecated gatsby-recipes#0.25.0: gatsby-recipes has been removed from gatsby/gatsby-cli >=4.5.0. Update to gatsby#latest/gatsby-cli#latest to use versions without gatsby-recipes. This package will no longer receive updates.
11:26:36 PM: npm WARN deprecated async-cache#1.1.0: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.
11:26:36 PM: npm WARN deprecated stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
11:26:37 PM: npm WARN deprecated querystring#0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:26:40 PM: npm WARN deprecated #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
11:26:40 PM: npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
11:26:43 PM: npm WARN deprecated #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
11:26:43 PM: npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
11:26:43 PM: npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
11:26:44 PM: npm WARN deprecated subscriptions-transport-ws#0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
11:26:47 PM: npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
11:26:49 PM: npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
11:26:49 PM: npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
11:26:49 PM: npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
11:40:12 PM: > sharp#0.29.3 install /opt/build/repo/node_modules/sharp
11:40:12 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
11:40:13 PM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-linux-x64.tar.br
11:40:14 PM: > #fortawesome/fontawesome-common-types#0.2.36 postinstall /opt/build/repo/node_modules/#fortawesome/fontawesome-common-types
11:40:14 PM: > node attribution.js
11:40:14 PM: Font Awesome Free 0.2.36 by #fontawesome - https://fontawesome.com
11:40:14 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:40:14 PM: > core-js#3.26.0 postinstall /opt/build/repo/node_modules/core-js
11:40:14 PM: > node -e "try{require('./postinstall')}catch(e){}"
11:40:14 PM: > core-js-pure#3.26.0 postinstall /opt/build/repo/node_modules/core-js-pure
11:40:14 PM: > node -e "try{require('./postinstall')}catch(e){}"
11:40:15 PM: > es5-ext#0.10.62 postinstall /opt/build/repo/node_modules/es5-ext
11:40:15 PM: > node -e "try{require('./_postinstall')}catch(e){}" || exit 0
11:40:15 PM: > gatsby-telemetry#2.14.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
11:40:15 PM: > node src/postinstall.js || true
11:40:15 PM: > gatsby-cli#3.14.2 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
11:40:15 PM: > node scripts/postinstall.js
11:40:15 PM: > #fortawesome/fontawesome-svg-core#1.2.36 postinstall /opt/build/repo/node_modules/#fortawesome/fontawesome-svg-core
11:40:15 PM: > node attribution.js
11:40:15 PM: Font Awesome Free 1.2.36 by #fontawesome - https://fontawesome.com
11:40:15 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:40:15 PM: > #fortawesome/free-solid-svg-icons#5.15.4 postinstall /opt/build/repo/node_modules/#fortawesome/free-solid-svg-icons
11:40:15 PM: > node attribution.js
11:40:15 PM: Font Awesome Free 5.15.4 by #fontawesome - https://fontawesome.com
11:40:15 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:40:15 PM: > gatsby#3.14.6 postinstall /opt/build/repo/node_modules/gatsby
11:40:15 PM: > node scripts/postinstall.js
11:40:16 PM: npm notice created a lockfile as package-lock.json. You should commit this file.
11:40:16 PM: npm WARN notsup Unsupported engine for gatsby-remark-katex#6.24.0: wanted: {"node":">=14.15.0"} (current: {"node":"12.18.0","npm":"6.14.4"})
11:40:16 PM: npm WARN notsup Not compatible with your version of node/npm: gatsby-remark-katex#6.24.0
11:40:16 PM: npm WARN notsup Unsupported engine for react-hook-form#7.39.3: wanted: {"node":">=12.22.0"} (current: {"node":"12.18.0","npm":"6.14.4"})
11:40:16 PM: npm WARN notsup Not compatible with your version of node/npm: react-hook-form#7.39.3
11:40:16 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.2 (node_modules/chokidar/node_modules/fsevents):
11:40:16 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:40:16 PM: npm WARN notsup Unsupported engine for type-fest#2.19.0: wanted: {"node":">=12.20"} (current: {"node":"12.18.0","npm":"6.14.4"})
11:40:16 PM: npm WARN notsup Not compatible with your version of node/npm: type-fest#2.19.0
11:40:16 PM: npm WARN notsup Unsupported engine for gatsby-plugin-postcss#5.24.0: wanted: {"node":">=14.15.0"} (current: {"node":"12.18.0","npm":"6.14.4"})
11:40:16 PM: npm WARN notsup Not compatible with your version of node/npm: gatsby-plugin-postcss#5.24.0
11:40:16 PM: npm WARN bootstrap#5.2.2 requires a peer of #popperjs/core#^2.11.6 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN gatsby-plugin-typography#3.14.0 requires a peer of typography#^0.16.0 || ^1.0.0-alpha.0 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN gatsby-remark-katex#6.24.0 requires a peer of gatsby#^4.0.0-next but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN gatsby-remark-katex#6.24.0 requires a peer of katex#^0.13.3 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN gatsby-remark-reading-time#1.1.0 requires a peer of gatsby#^2.0.0 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN eslint-config-react-app#6.0.0 requires a peer of babel-eslint#^10.0.0 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN tsutils#3.21.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN ts-node#9.1.1 requires a peer of typescript#>=2.7 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN acorn-import-assertions#1.8.0 requires a peer of acorn#^8 but none is installed. You must install peer dependencies yourself.
11:40:16 PM: npm WARN gatsby-plugin-postcss#5.24.0 requires a peer of gatsby#^4.0.0-next but none is installed. You must install peer dependencies yourself.
11:40:16 PM: added 2214 packages from 1135 contributors and audited 2219 packages in 831.887s
11:40:17 PM: 363 packages are looking for funding
11:40:17 PM: run `npm fund` for details
11:40:17 PM: found 38 vulnerabilities (16 moderate, 16 high, 6 critical)
11:40:17 PM: run `npm audit fix` to fix them, or `npm audit` for details
11:40:17 PM: NPM modules installed
11:40:17 PM: Creating package sha
11:40:17 PM: Started restoring cached go cache
11:40:17 PM: Finished restoring cached go cache
11:40:17 PM: Installing Go version 1.14.4 (requested 1.14.4)
11:40:21 PM: unset GOOS;
11:40:21 PM: unset GOARCH;
11:40:21 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.14.4.linux.amd64';
11:40:21 PM: export PATH="/opt/buildhome/.gimme/versions/go1.14.4.linux.amd64/bin:${PATH}";
11:40:21 PM: go version >&2;
11:40:21 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.14.4.linux.amd64.env"
11:40:21 PM: go version go1.14.4 linux/amd64
11:40:21 PM: Detected 1 framework(s)
11:40:21 PM: "gatsby" at version "3.14.6"
11:40:21 PM: Installing missing commands
11:40:21 PM: Verify run directory
11:40:23 PM: ​
11:40:23 PM: ────────────────────────────────────────────────────────────────
11:40:23 PM: Netlify Build
11:40:23 PM: ────────────────────────────────────────────────────────────────
11:40:23 PM: ​
11:40:23 PM: ❯ Version
11:40:23 PM: #netlify/build 28.1.13
11:40:23 PM: ​
11:40:23 PM: ❯ Flags
11:40:23 PM: baseRelDir: true
11:40:23 PM: buildId: 63712fb964e5d200085e449c
11:40:23 PM: deployId: 63712fb964e5d200085e449e
11:40:23 PM: ​
11:40:23 PM: ❯ Current directory
11:40:23 PM: /opt/build/repo
11:40:23 PM: ​
11:40:23 PM: ❯ Config file
11:40:23 PM: No config file was defined: using default values.
11:40:23 PM: ​
11:40:23 PM: ❯ Context
11:40:23 PM: production
11:40:23 PM: ​
11:40:23 PM: ────────────────────────────────────────────────────────────────
11:40:23 PM: 1. Build command from Netlify app
11:40:23 PM: ────────────────────────────────────────────────────────────────
11:40:23 PM: ​
11:40:23 PM: $ npm run build
11:40:23 PM: > gatsby-starter-hello-world#0.1.0 build /opt/build/repo
11:40:23 PM: > gatsby build
11:40:24 PM: warning Plugin gatsby-plugin-postcss is not compatible with your gatsby version 3.14.6 - It requires gatsby#^4.0.0-next
11:40:25 PM: warning Plugin gatsby-remark-reading-time is not compatible with your gatsby version 3.14.6 - It requires gatsby#^2.0.0
11:40:25 PM: warning Plugin gatsby-plugin-postcss is not compatible with your gatsby version 3.14.6 - It requires gatsby#^4.0.0-next
11:40:25 PM: warning Plugin gatsby-remark-reading-time is not compatible with your gatsby version 3.14.6 - It requires gatsby#^2.0.0
11:40:25 PM: success open and validate gatsby-configs, load plugins - 0.580s
11:40:25 PM: success onPreInit - 0.002s
11:40:25 PM: success initialize cache - 0.031s
11:40:25 PM: success copy gatsby files - 0.034s
11:40:25 PM: success Compiling Gatsby Functions - 0.159s
11:40:25 PM: success onPreBootstrap - 0.166s
11:40:26 PM: success createSchemaCustomization - 0.411s
11:40:34 PM: success Checking for changed pages - 0.000s
11:40:34 PM: success source and transform nodes - 8.299s
11:40:35 PM: success building schema - 0.396s
11:40:35 PM: success createPages - 0.158s
11:40:35 PM: success createPagesStatefully - 0.064s
11:40:35 PM: info Total nodes: 2699, SitePage nodes: 541 (use --verbose for breakdown)
11:40:35 PM: success Checking for changed pages - 0.000s
11:40:35 PM: success update schema - 0.099s
11:40:35 PM: success onPreExtractQueries - 0.000s
11:40:35 PM: success extract queries from components - 0.305s
11:40:35 PM: success write out redirect data - 0.000s
11:40:35 PM: success onPostBootstrap - 0.000s
11:40:35 PM: info bootstrap finished - 12.272s
11:40:35 PM: success run static queries - 0.003s - 1/1 324.33/s
11:41:40 PM: success run page queries - 64.400s - 541/541 8.40/s
11:41:40 PM: success write out requires - 0.007s
11:41:56 PM: success Building production JavaScript and CSS bundles - 16.351s
11:41:56 PM: success Rewriting compilation hashes - 0.048s
11:41:56 PM: success Writing page-data.json files to public directory - 0.440s - 541/541 1229.54/s
11:42:01 PM: success Building HTML renderer - 2.486s
11:42:02 PM: error Page data from page-data.json for the failed page "/review-January-2022/": {
11:42:02 PM: "componentChunkName": "component---src-templates-blog-post-js",
11:42:02 PM: "path": "/review-January-2022/",
11:42:02 PM: "result": {
11:42:02 PM: "data": {
11:42:02 PM: "markdownRemark": {
11:42:02 PM: "html": "<p>In January, I achieved my target of writing 10 blog posts.</p>\n<p>My original plan was to build a developer blog using Gatsby. Even though I started following the tutorial on the official Gatsby site, I veered off course. I practiced a little b...",
11:42:02 PM: "frontmatter": {
11:42:02 PM: "title": "Review - January, 2022",
11:42:02 PM: "date": "2022-02-01"
11:42:02 PM: }
11:42:02 PM: }
11:42:02 PM: },
11:42:02 PM: "pageContext": {
11:42:02 PM: "slug": "/review-January-2022/",
11:42:02 PM: "prev": {
11:42:02 PM: "fields": {
11:42:02 PM: "slug": "/define-python-functions-with-unlimited-keyword-arguments-using-kwargs/"
11:42:02 PM: },
11:42:02 PM: "frontmatter": {
11:42:02 PM: "modules": null
11:42:02 PM: }
11:42:02 PM: },
11:42:02 PM: "next": {
11:42:02 PM: "fields": {
11:42:02 PM: "slug": "/check-the-type-of-a-python-variable/"
11:42:02 PM: },
11:42:02 PM: "frontmatter": {
11:42:02 PM: "modules": null
11:42:02 PM: }
11:42:02 PM: }
11:42:02 PM: }
11:42:02 PM: },
11:42:02 PM: "staticQueryHashes": [
11:42:02 PM: "3159585216"
11:42:02 PM: ]
11:42:02 PM: }
11:42:02 PM: failed Building static HTML for pages - 1.409s
11:42:02 PM: error Building static HTML failed for path "/review-January-2022/"
11:42:02 PM:
11:42:02 PM: 100 | }
11:42:02 PM: 101 |
11:42:02 PM: > 102 | return merge(a, b, { arrayMerge: combineMerge })
11:42:02 PM: | ^
11:42:02 PM: 103 | }
11:42:02 PM: 104 |
11:42:02 PM: 105 | export default async function staticPage({
11:42:02 PM:
11:42:02 PM: WebpackError: TypeError: merge is not a function (from plugin: gatsby-plugin-r eact-helmet)
11:42:02 PM:
11:42:02 PM: - static-entry.js:102
11:42:02 PM: gatsby-starter-hello-world/.cache/static-entry.js:102:10
11:42:02 PM:
11:42:02 PM: - static-entry.js:166
11:42:02 PM: gatsby-starter-hello-world/.cache/static-entry.js:166:24
11:42:02 PM:
11:42:02 PM: - gatsby-ssr.js:17
11:42:02 PM: [gatsby-starter-hello-world]/[gatsby-plugin-react-helmet]/gatsby-ssr.js:17:5
11:42:02 PM: - api-runner-ssr.js:52
11:42:02 PM: gatsby-starter-hello-world/.cache/api-runner-ssr.js:52:22
11:42:02 PM:
11:42:02 PM: - api-runner-ssr.js:45
11:42:02 PM: gatsby-starter-hello-world/.cache/api-runner-ssr.js:45:11
11:42:02 PM:
11:42:02 PM: - static-entry.js:307
11:42:02 PM: gatsby-starter-hello-world/.cache/static-entry.js:307:5
11:42:02 PM:
11:42:02 PM: - index.es.js:121
11:42:02 PM: [gatsby-starter-hello-world]/[#fortawesome]/free-solid-svg-icons/index.es.js :121:1
11:42:02 PM:
11:42:02 PM:
11:42:02 PM: not finished Caching JavaScript and CSS webpack compilation - 6.127s
11:42:02 PM: not finished Caching HTML renderer compilation - 1.518s
11:42:02 PM: npm ERR! code ELIFECYCLE
11:42:02 PM: npm ERR! errno 1
11:42:02 PM: npm ERR! gatsby-starter-hello-world#0.1.0 build: `gatsby build`
11:42:02 PM: npm ERR! Exit status 1
11:42:02 PM: npm ERR!
11:42:02 PM: npm ERR! Failed at the gatsby-starter-hello-world#0.1.0 build script.
11:42:02 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
11:42:02 PM: npm ERR! A complete log of this run can be found in:
11:42:02 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-11-13T18_12_02_730Z-debug.log
11:42:02 PM: ​
11:42:02 PM: ────────────────────────────────────────────────────────────────
11:42:02 PM: "build.command" failed
11:42:02 PM: ────────────────────────────────────────────────────────────────
11:42:02 PM: ​
11:42:02 PM: Error message
11:42:02 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
11:42:02 PM: ​
11:42:02 PM: Error location
11:42:02 PM: In Build command from Netlify app:
11:42:02 PM: npm run build
11:42:02 PM: ​
11:42:02 PM: Resolved config
11:42:02 PM: build:
11:42:02 PM: command: npm run build
11:42:02 PM: commandOrigin: ui
11:42:02 PM: publish: /opt/build/repo/public
11:42:02 PM: publishOrigin: ui
11:42:03 PM: Caching artifacts
11:42:03 PM: Started saving node modules
11:42:03 PM: Finished saving node modules
11:42:03 PM: Started saving build plugins
11:42:03 PM: Finished saving build plugins
11:42:03 PM: Started saving pip cache
11:42:03 PM: Finished saving pip cache
11:42:03 PM: Started saving emacs cask dependencies
11:42:03 PM: Finished saving emacs cask dependencies
11:42:03 PM: Started saving maven dependencies
11:42:03 PM: Finished saving maven dependencies
11:42:03 PM: Started saving boot dependencies
11:42:03 PM: Finished saving boot dependencies
11:42:03 PM: Started saving rust rustup cache
11:42:03 PM: Finished saving rust rustup cache
11:42:03 PM: Started saving go dependencies
11:42:03 PM: Finished saving go dependencies
11:42:08 PM: Cached ruby version 2.7.1
11:42:08 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:42:08 PM: Creating deploy upload records
11:42:08 PM: Failing build: Failed to build site
11:42:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
11:42:08 PM: Finished processing build request in 15m58.036179676s
What do I need to do to fix this error?
Found this on GitHub:
"Another temporary solution is adding explicitely deepmerge dependency to your project."
Hope it helps.
https://github.com/gatsbyjs/gatsby/issues/33274

Build failing when deploying to netlify

Code builds without any errors or warnings in my local machine and runs with no problems at all. This is my first webpage, and I just cannot get it to deploy. I have been stuck in this step for a few days now and I am getting so tired looking at it. If anyone has an idea of that is going on I would really appreciate it. I am running MAC OS and VS CODE
2:10:21 PM: ​
2:10:21 PM: $ yarn build
2:10:22 PM: yarn run v1.22.19
2:10:22 PM: $ next build
2:10:22 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2:10:22 PM: info - Linting and checking validity of types...
2:10:24 PM: info - Creating an optimized production build...
2:10:26 PM: Failed to compile.
2:10:26 PM:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: Module not found: Can't resolve '/Users/santiagoramirez/landing_githubpages/public/hhh.png' in '/opt/build/repo/pages/components'
2:10:26 PM: Import trace for requested module:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: Module not found: Can't resolve '/Users/santiagoramirez/landing_githubpages/public/img100.png' in '/opt/build/repo/pages/components'
2:10:26 PM: Import trace for requested module:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: Module not found: Can't resolve '/Users/santiagoramirez/landing_githubpages/public/img9.jpg' in '/opt/build/repo/pages/components'
2:10:26 PM: Import trace for requested module:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: Module not found: Can't resolve '/Users/santiagoramirez/landing_githubpages/public/img15.png' in '/opt/build/repo/pages/components'
2:10:26 PM: Import trace for requested module:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: Module not found: Can't resolve '/Users/santiagoramirez/landing_githubpages/public/img11.webp' in '/opt/build/repo/pages/components'
2:10:26 PM: Import trace for requested module:
2:10:26 PM: ./pages/components/Instagram.jsx
2:10:26 PM: > Build failed because of webpack errors
2:10:26 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
2:10:26 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2:10:26 PM: ​
2:10:26 PM: ────────────────────────────────────────────────────────────────
2:10:26 PM: "build.command" failed
2:10:26 PM: ────────────────────────────────────────────────────────────────
2:10:26 PM: ​
2:10:26 PM: Error message
2:10:26 PM: Command failed with exit code 1: yarn build (https://ntl.fyi/exit-code-1)
2:10:26 PM: ​
2:10:26 PM: Error location
2:10:26 PM: In Build command from Netlify app:
2:10:26 PM: yarn build
2:10:26 PM: ​
2:10:26 PM: Resolved config
2:10:26 PM: build:
2:10:26 PM: command: yarn build
2:10:26 PM: commandOrigin: ui
2:10:26 PM: environment:
2:10:26 PM: - NEXT_PRIVATE_TARGET
2:10:26 PM: publish: /opt/build/repo/.next
2:10:26 PM: publishOrigin: ui
2:10:26 PM: plugins:
2:10:26 PM: - inputs: {}
2:10:26 PM: origin: ui
2:10:26 PM: package: '#netlify/plugin-nextjs'
2:10:27 PM: Caching artifacts
2:10:27 PM: Started saving node modules
2:10:27 PM: Finished saving node modules
2:10:27 PM: Started saving build plugins
2:10:27 PM: Finished saving build plugins
2:10:27 PM: Started saving yarn cache
2:10:29 PM: Finished saving yarn cache
2:10:29 PM: Started saving pip cache
2:10:29 PM: Finished saving pip cache
2:10:29 PM: Started saving emacs cask dependencies
2:10:29 PM: Finished saving emacs cask dependencies
2:10:29 PM: Started saving maven dependencies
2:10:29 PM: Finished saving maven dependencies
2:10:29 PM: Started saving boot dependencies
2:10:29 PM: Finished saving boot dependencies
2:10:29 PM: Started saving rust rustup cache
2:10:29 PM: Finished saving rust rustup cache
2:10:29 PM: Started saving go dependencies
2:10:29 PM: Finished saving go dependencies
2:10:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:10:31 PM: Creating deploy upload records
2:10:31 PM: Failing build: Failed to build site
2:10:31 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
2:10:31 PM: Finished processing build request in 38.844689685s

Problem with gatsby: command not found when deploying gatsby site to netlify

I was trying to deploy gatsby site to Netlify. I commit all files from public directory within gatsby project to my github repository and then deploy that repository on netlify, but I got an error.
After pushing to github all files and directories except for public and then deploy I got following error:
12:23:37 PM: ​
12:23:37 PM: ┌─────────────────────────────┐
12:23:37 PM: │ Netlify Build │
12:23:37 PM: └─────────────────────────────┘
12:23:37 PM: ​
12:23:37 PM: ❯ Version
12:23:37 PM: #netlify/build 3.3.0
12:23:37 PM: ​
12:23:37 PM: ❯ Flags
12:23:37 PM: deployId: 5f4637d3e090c2ab4a26309c
12:23:37 PM: mode: buildbot
12:23:37 PM: ​
12:23:37 PM: ❯ Current directory
12:23:37 PM: /opt/build/repo
12:23:37 PM: ​
12:23:37 PM: ❯ Config file
12:23:37 PM: No config file was defined: using default values.
12:23:37 PM: ​
12:23:37 PM: ❯ Context
12:23:37 PM: production
12:23:37 PM: ​
12:23:37 PM: ┌───────────────────────────────────┐
12:23:37 PM: │ 1. Build command from Netlify app │
12:23:37 PM: └───────────────────────────────────┘
12:23:37 PM: ​
12:23:37 PM: $ gatsby build
12:23:40 PM: success open and validate gatsby-configs - 0.022s
12:23:40 PM: success load plugins - 0.498s
12:23:40 PM: success onPreInit - 0.040s
12:23:40 PM: success delete html and css files from previous builds - 0.002s
12:23:40 PM: success initialize cache - 0.006s
12:23:41 PM: success copy gatsby files - 0.028s
12:23:41 PM: success onPreBootstrap - 0.005s
12:23:41 PM: success createSchemaCustomization - 0.006s
12:23:41 PM: success Checking for changed pages - 0.000s
12:23:41 PM: success source and transform nodes - 0.086s
12:23:41 PM: success building schema - 0.271s
12:23:41 PM: success createPages - 0.001s
12:23:41 PM: success Checking for changed pages - 0.000s
12:23:41 PM: success createPagesStatefully - 0.067s
12:23:41 PM: success update schema - 0.023s
12:23:41 PM: success onPreExtractQueries - 0.001s
12:23:43 PM: success extract queries from components - 2.444s
12:23:43 PM: success write out redirect data - 0.001s
12:23:43 PM: success onPostBootstrap - 0.000s
12:23:43 PM: info bootstrap finished - 6.517s
12:23:44 PM: success run static queries - 0.017s - 1/1 60.34/s
12:23:44 PM: success run page queries - 0.004s - 1/1 241.80/s
12:23:44 PM: success write out requires - 0.004s
12:24:11 PM: success Building production JavaScript and CSS bundles - 27.400s
12:24:11 PM: success Rewriting compilation hashes - 0.002s
12:24:15 PM: failed Building static HTML for pages - 3.641s
12:24:15 PM: error "document" is not available during server side rendering.
12:24:15 PM:
12:24:15 PM: > 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),s=o(c),f=n(8),d=o(f),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void
12:24:15 PM: | ^
12:24:15 PM:
12:24:15 PM: WebpackError: ReferenceError: document is not defined
12:24:15 PM:
12:24:15 PM: - aos.js:1
12:24:15 PM: node_modules/aos/dist/aos.js:1:14565
12:24:15 PM:
12:24:15 PM: - aos.js:1
12:24:15 PM: node_modules/aos/dist/aos.js:1:1506
12:24:15 PM:
12:24:15 PM: - Technologie.js:8
12:24:15 PM: src/components/Technologie.js:8:5
12:24:15 PM:
12:24:15 PM: - index.js:1
12:24:15 PM: src/pages/index.js:1:1
12:24:15 PM:
12:24:15 PM: - getLayoutRect.js:1
12:24:15 PM: node_modules/#popperjs/core/lib/dom-utils/getLayoutRect.js:1:1
12:24:15 PM:
12:24:15 PM:
12:24:15 PM: ​
12:24:15 PM: ┌─────────────────────────────┐
12:24:15 PM: │ "build.command" failed │
12:24:15 PM: └─────────────────────────────┘
12:24:15 PM: ​
12:24:15 PM: Error message
12:24:15 PM: Command failed with exit code 1: gatsby build
12:24:15 PM: ​
12:24:15 PM: Error location
12:24:15 PM: In Build command from Netlify app:
12:24:15 PM: gatsby build
12:24:15 PM: ​
12:24:15 PM: Resolved config
12:24:15 PM: build:
12:24:15 PM: command: gatsby build
12:24:15 PM: commandOrigin: ui
12:24:15 PM: publish: /opt/build/repo/public
12:24:15 PM: Caching artifacts
12:24:15 PM: Started saving node modules
12:24:15 PM: Finished saving node modules
12:24:15 PM: Started saving build plugins
12:24:15 PM: Finished saving build plugins
12:24:15 PM: Started saving pip cache
12:24:15 PM: Finished saving pip cache
12:24:15 PM: Started saving emacs cask dependencies
12:24:15 PM: Finished saving emacs cask dependencies
12:24:15 PM: Started saving maven dependencies
12:24:15 PM: Finished saving maven dependencies
12:24:15 PM: Started saving boot dependencies
12:24:15 PM: Finished saving boot dependencies
12:24:15 PM: Started saving go dependencies
12:24:15 PM: Finished saving go dependencies
12:24:18 PM: Error running command: Build script returned non-zero exit code: 1
12:24:18 PM: Failing build: Failed to build site
12:24:18 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
12:24:19 PM: Finished processing build request in 2m5.540557721s
Any suggestions? Thanks in advance.
There's a process misunderstanding there. In your repository, you should commit all files except your /public folder since it's the one that will be generated in the building and deploy process in Netlify. In addition, your netlify.toml is not adding any useful command to Netlify because they are added by default in the dashboard. As you can see in:
Note: you can find this configuration under https://app.netlify.com/sites/YOUR_PROJECT_NAME/settings/deploys
Your command is failing because you are doing the Netlify work in your repository. You are uploading a built folder (/public) that doesn't contain any package.json nor build commands so your command is unrecognized.
You must upload all files except your /public folder in your repository and let Netlify do the build process. In addition, you can improve your netlify.toml by removing the default commands.
With the new edited content it's inferred that
this build must fail locally too before pushing it to Netlify. In Gatsby, you have to check for the availability of the global objects (like window or document before using it).
It's a broad question and spreads the topic of it. If the error is in your code (you are using document object) you need to add a condition first:
If (typeof document !== 'undefined') {
//Your code here
}
If the error comes from an external source (library or dependency using window or document internally), you need to add a null loader in your webpack's configuration:
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /bad-module/,
use: loaders.null(),
},
],
},
})
}
}
Replacing /bad-module/ for the library path in node_modules.
You can check for further details in Debugging HTML Builds Documentation
To add properly AOS package add this to your page/component:
componentDidMount() {
const AOS = require('aos');
this.aos = AOS this.aos.init()
}
componentDidUpdate() {
this.aos.refresh()
}
Or using hooks:
let AOS;
useEffect(() => {
/** * Server-side rendering does not provide the 'document' object
* therefore this import is required either in useEffect or componentDidMount as they
* are exclusively executed on a client */
const AOS = require("aos");
AOS.init({ once: true, }); }, []);
useEffect(() => { if (AOS) { AOS.refresh(); } });

latest changes not showing on Netlify after deployment

This is my first time deploying a react js app to Netlify and I'm facing some issues.
every time I try to push new commits to GitHub Netlify automatically deploys it but the changes don't seem to take effect for some reason.
Here's the deployment log:
2:03:20 PM: Waiting for other deploys from your team to complete
2:03:41 PM: Build ready to start
2:03:43 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
2:03:43 PM: build-image tag: v3.3.20
2:03:43 PM: buildbot version: be8ecf2af866e16fa4301cc5c14de2ccbbb21cf4
2:03:43 PM: Fetching cached dependencies
2:03:43 PM: Starting to download cache of 114.5MB
2:03:45 PM: Finished downloading cache in 1.515845861s
2:03:45 PM: Starting to extract cache
2:03:50 PM: Finished extracting cache in 5.156934064s
2:03:50 PM: Finished fetching cache in 6.69538965s
2:03:50 PM: Starting to prepare the repo for build
2:03:50 PM: Preparing Git Reference refs/heads/master
2:03:52 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus 'build/' in the Netlify UI
2:03:52 PM: Starting build script
2:03:52 PM: Installing dependencies
2:03:52 PM: Python version set to 2.7
2:03:52 PM: Started restoring cached node version
2:03:55 PM: Finished restoring cached node version
2:03:55 PM: v12.18.0 is already installed.
2:03:56 PM: Now using node v12.18.0 (npm v6.14.4)
2:03:56 PM: Started restoring cached build plugins
2:03:56 PM: Finished restoring cached build plugins
2:03:56 PM: Attempting ruby version 2.7.1, read from environment
2:03:57 PM: Using ruby version 2.7.1
2:03:57 PM: Using PHP version 5.6
2:03:57 PM: 5.2 is already installed.
2:03:57 PM: Using Swift version 5.2
2:03:57 PM: Started restoring cached node modules
2:03:57 PM: Finished restoring cached node modules
2:03:58 PM: Started restoring cached go cache
2:03:58 PM: Finished restoring cached go cache
2:03:58 PM: go version go1.14.4 linux/amd64
2:03:58 PM: go version go1.14.4 linux/amd64
2:03:58 PM: Installing missing commands
2:03:58 PM: Verify run directory
2:03:59 PM: ​
2:03:59 PM: ┌─────────────────────────────┐
2:03:59 PM: │ Netlify Build │
2:03:59 PM: └─────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: ❯ Version
2:03:59 PM: #netlify/build 3.0.1
2:03:59 PM: ​
2:03:59 PM: ❯ Flags
2:03:59 PM: deployId: 5f16bd6759d4ae00096bdb64
2:03:59 PM: mode: buildbot
2:03:59 PM: ​
2:03:59 PM: ❯ Current directory
2:03:59 PM: /opt/build/repo
2:03:59 PM: ​
2:03:59 PM: ❯ Config file
2:03:59 PM: No config file was defined: using default values.
2:03:59 PM: ​
2:03:59 PM: ❯ Context
2:03:59 PM: production
2:03:59 PM: ​
2:03:59 PM: ┌───────────────────────────────────┐
2:03:59 PM: │ 1. Build command from Netlify app │
2:03:59 PM: └───────────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: $ npm run
2:03:59 PM: Lifecycle scripts included in cortex_app:
2:03:59 PM: start
2:03:59 PM: react-scripts start
2:03:59 PM: test
2:03:59 PM: react-scripts test
2:03:59 PM: available via `npm run-script`:
2:03:59 PM: build
2:03:59 PM: react-scripts build
2:03:59 PM: eject
2:03:59 PM: react-scripts eject
2:03:59 PM: ​
2:03:59 PM: (build.command completed in 303ms)
2:03:59 PM: ​
2:03:59 PM: ┌─────────────────────────────┐
2:03:59 PM: │ Netlify Build Complete │
2:03:59 PM: └─────────────────────────────┘
2:03:59 PM: ​
2:03:59 PM: (Netlify Build completed in 322ms)
2:03:59 PM: Caching artifacts
2:03:59 PM: Started saving node modules
2:03:59 PM: Finished saving node modules
2:03:59 PM: Started saving build plugins
2:03:59 PM: Finished saving build plugins
2:03:59 PM: Started saving pip cache
2:03:59 PM: Finished saving pip cache
2:03:59 PM: Started saving emacs cask dependencies
2:03:59 PM: Finished saving emacs cask dependencies
2:03:59 PM: Started saving maven dependencies
2:03:59 PM: Finished saving maven dependencies
2:03:59 PM: Started saving boot dependencies
2:03:59 PM: Finished saving boot dependencies
2:03:59 PM: Started saving go dependencies
2:03:59 PM: Finished saving go dependencies
2:03:59 PM: Build script success
2:03:59 PM: Starting to deploy site from 'build'
2:03:59 PM: Creating deploy tree
2:03:59 PM: Creating deploy upload records
2:03:59 PM: 0 new files to upload
2:03:59 PM: 0 new functions to upload
2:03:59 PM: Starting post processing
2:03:59 PM: Post processing - HTML
2:04:00 PM: Post processing - redirect rules
2:04:00 PM: Post processing - header rules
2:04:00 PM: Post processing done
2:04:00 PM: Site is live
2:04:19 PM: Finished processing build request in 36.032433755s
the latest commit is 9421ef1 and the changes are visible on the GitHub repo. so what might be the problem in case somebody else was facing a similar issue?
It looks like your netlify build command is set to npm run, that needs to be npm run build for Netlify to know how to build your React app into a production site.
You can change that in your netlify.toml or in your Build Settings on the Netlify website.

Resources