Netlify build failed with warn `isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`

Looking forward to fix the below Netlify issue. I have been trying to fix this no luck. Appreciate your help Netlify Forum. I do get Build Failed with warn isModuleDeclaration has been deprecated, please migrate to isImportOrExportDeclaration.

Works fine in my localhost.

My build settings screen share below.

Netlify error

I have set Env. variable CI = False, Node version - 14.18.0

This project uses Gatsby starter repo as following the package.json is.

{
“name”: “gatsby-starter-default”,
“private”: true,
“description”: “A simple starter to get up and developing quickly with Gatsby”,
“version”: “0.1.0”,
“author”: “Kyle Mathews <mathews.kyleatgmail.com>”,
“dependencies”: {
“apollo/client”: “^3.2.9”,
“gatsbyjs/reach-router”: “^2.0.1”,
“material-ui/core”: “^4.11.0”,
“material-ui/data-grid”: “^4.0.0-alpha.21”,
“material-ui/lab”: “^4.0.0-alpha.56”,
“axios”: “^0.21.4”,
“bootstrap”: “^5.2.3”,
“cross-fetch”: “^3.0.6”,
“es”: “^0.8.0”,
“font-awesome”: “^4.7.0”,
“gatsby”: “^2.24.61”,
“gatsby-image”: “^2.4.19”,
“gatsby-plugin-image”: “^1.10.1”,
“gatsby-plugin-manifest”: “^2.4.30”,
“gatsby-plugin-material-ui”: “^2.1.10”,
“gatsby-plugin-offline”: “^3.2.28”,
“gatsby-plugin-react-helmet”: “^3.3.11”,
“gatsby-plugin-sharp”: “^2.6.36”,
“gatsby-plugin-web-font-loader”: “^1.0.4”,
“gatsby-source-filesystem”: “^2.3.30”,
“gatsby-source-strapi”: “^1.0.3”,
“gatsby-transformer-sharp”: “^2.5.15”,
“node”: “^16.13.0”,
“node-polyfill-webpack-plugin”: “^2.0.1”,
“prop-types”: “^15.8.1”,
“react”: “^16.12.0”,
“react-bootstrap”: “^2.7.2”,
“react-dom”: “^16.12.0”,
“react-elastic-carousel”: “^0.11.5”,
“react-helmet”: “^6.1.0”,
“react-lottie”: “^1.2.3”,
“react-multi-carousel”: “^2.8.3”,
“react-resize-aware”: “^3.1.0”,
“react-slick”: “^0.29.0”,
“slick-carousel”: “^1.8.1”,
“styled-components”: “^5.3.8”,
“uuid”: “^8.3.2”
},
“devDependencies”: {
“prettier”: “2.1.1”
},
“keywords”: [
“gatsby”
],
“license”: “0BSD”,
“scripts”: {
“build”: “gatsby build”,
“develop”: “gatsby develop”,
“format”: “prettier --write "**/*.{js,jsx,ts,tsx,json,md}"”,
“start”: “npm run develop”,
“serve”: “gatsby serve”,
“clean”: “gatsby clean”,
“test”: “echo "Write tests! → Link not found - Rebrandly” && exit 1"
},
“repository”: {
“type”: “git”,
“url”: “GitHub - gatsbyjs/gatsby-starter-default: The default Gatsby starter
},
“bugs”: {
“url”: “thub.com/gatsbyjs/gatsby/issues
}
}

Logs:
────────────────────────────────────────────────────────────────
2:03:03 PM: ​
2:03:03 PM: $ CI= npm run build
2:03:03 PM: > gatsby-starter-defaultat0.1.0 build /opt/build/repo/frontend
2:03:03 PM: > gatsby build
2:03:05 PM: success open and validate gatsby-configs - 0.039s
2:03:05 PM: success load plugins - 0.396s
2:03:05 PM: success onPreInit - 0.020s
2:03:05 PM: success delete html and css files from previous builds - 0.002s
2:03:05 PM: success initialize cache - 0.004s
2:03:05 PM: success copy gatsby files - 0.023s
2:03:05 PM: success onPreBootstrap - 0.009s
2:03:05 PM: success createSchemaCustomization - 0.005s
2:03:05 PM: info Starting to fetch data from Strapi - with params {“_limit”:1000}
2:03:05 PM: info Starting to fetch data from Strapi - with params {“_limit”:1000}
2:03:05 PM: info Starting to fetch data from Strapi - with params {“_limit”:1000}
2:03:06 PM: success Fetched Strapi Data - 0.424s
2:03:06 PM: success Checking for changed pages - 0.000s
2:03:06 PM: success source and transform nodes - 0.552s
2:03:06 PM: success building schema - 0.421s
2:03:06 PM: info Total nodes: 184, SitePage nodes: 15 (use --verbose for breakdown)
2:03:06 PM: success createPages - 0.024s
2:03:06 PM: success Checking for changed pages - 0.000s
2:03:06 PM: success createPagesStatefully - 0.044s
2:03:06 PM: success update schema - 0.027s
2:03:06 PM: success onPreExtractQueries - 0.000s
2:03:07 PM: success extract queries from components - 0.836s
2:03:07 PM: success write out redirect data - 0.000s
2:03:07 PM: success onPostBootstrap - 0.000s
2:03:07 PM: info bootstrap finished - 4.453s
2:03:07 PM: success run static queries - 0.012s - 4/4 334.16/s
2:03:07 PM: success run page queries - 0.015s - 25/25 1718.48/s
2:03:07 PM: success write out requires - 0.002s
2:03:08 PM: warning isModuleDeclaration has been deprecated, please migrate to isImportOrExportDeclaration
2:03:08 PM: at isModuleDeclaration (/opt/build/repo/frontend/node_modules/atbabel/types/lib/validators/generated/index.js:2748:35)
2:03:08 PM: at PluginPass.Program (/opt/build/repo/frontend/node_modules/babel-plugin-lodash/lib/index.js:102:44)
2:03:34 PM: failed Building production JavaScript and CSS bundles - 26.352s
2:03:34 PM: Failed to validate error Error [ValidationError]: child “location” fails because [child “start” fails because [“index” is not allowed]]
2:03:34 PM: at Object.exports.process (/opt/build/repo/frontend/node_modules/aerrors.js:202:19)
2:03:34 PM: at internals.Object._validateWithOptions (/opt/build/repo/frontend/node_modules/athapi/joi/lib/types/any/index.js:763:31)
2:03:34 PM: at internals.Object.validate (/opt/build/repo/frontend/node_modules/athapi/joi/lib/types/any/index.js:797:21)
2:03:34 PM: at constructError (/opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/structured-errors/construct-error.js:52:32)
2:03:34 PM: at Reporter.error (/opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporter.js:135:59)
2:03:34 PM: at /opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporter.js:123:48
2:03:34 PM: at Array.map ()
2:03:34 PM: at Reporter.error (/opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporter.js:123:26)
2:03:34 PM: at Reporter.panic (/opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporter.js:75:34)
2:03:34 PM: at Object.panic (/opt/build/repo/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporter-timer.js:52:23)
2:03:34 PM: at build (/opt/build/repo/frontend/node_modules/gatsby/src/commands/build.ts:146:24) {
2:03:34 PM: isJoi: true,
2:03:34 PM: details: [
2:03:34 PM: {
2:03:34 PM: message: ““index” is not allowed”,
2:03:34 PM: path: [Array],
2:03:34 PM: type: “object.allowUnknown”,
2:03:34 PM: context: [Object]
2:03:34 PM: }
2:03:34 PM: ],
2:03:34 PM: _object: {
2:03:34 PM: context: {
2:03:34 PM: stage: “build-javascript”,
2:03:34 PM: stageLabel: “Generating JavaScript bundles”,
2:03:34 PM: sourceMessage: “/opt/build/repo/frontend/src/pages/using-ssr.js: Unexpected token (30:6)\n” +
2:03:34 PM: “\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 28 |\x1B[39m \x1B[90m// .\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 29 |\x1B[39m \x1B[90m//

\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 30 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33mLink\x1B[39m to\x1B[33m=\x1B[39m\x1B[32m”/“\x1B[39m\x1B[33m>\x1B[39m\x1B[33mGo\x1B[39m back to the homepage\x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLink\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 31 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLayout\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 32 |\x1B[39m )\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 33 |\x1B[39m }\x1B[0m”
2:03:34 PM: },
2:03:34 PM: filePath: “/opt/build/repo/frontend/src/pages/using-ssr.js”,
2:03:34 PM: location: { start: [Position] },
2:03:34 PM: text: “Generating JavaScript bundles failed\n” +
2:03:36 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
2:03:34 PM: “\n” +
2:03:34 PM: “/opt/build/repo/frontend/src/pages/using-ssr.js: Unexpected token (30:6)\n” +
2:03:34 PM: “\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 28 |\x1B[39m \x1B[90m// .\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 29 |\x1B[39m \x1B[90m//

\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 30 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33mLink\x1B[39m to\x1B[33m=\x1B[39m\x1B[32m”/“\x1B[39m\x1B[33m>\x1B[39m\x1B[33mGo\x1B[39m back to the homepage\x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLink\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 31 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLayout\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 32 |\x1B[39m )\x1B[0m\n” +
2:03:34 PM: “\x1B[0m \x1B[90m 33 |\x1B[39m }\x1B[0m”,
2:03:34 PM: type: “WEBPACK”,
2:03:34 PM: level: “ERROR”,
2:03:34 PM: stack: ,
2:03:34 PM: docsUrl: “How to File an Issue | Gatsby”,
2:03:34 PM: code: “98123”
2:03:34 PM: },
2:03:34 PM: annotate: [Function (anonymous)]
2:03:34 PM: }
2:03:34 PM: npm ERR! code ELIFECYCLE
2:03:34 PM: npm ERR! errno 1
2:03:34 PM: npm ERR! gatsby-starter-defaultat0.1.0 build: gatsby build
2:03:34 PM: npm ERR! Exit status 1
2:03:34 PM: npm ERR!
2:03:34 PM: npm ERR! Failed at the gatsby-starter-defaultat0.1.0 build script.
2:03:34 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:03:34 PM: npm ERR! A complete log of this run can be found in:
2:03:34 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-10-04T18_03_34_777Z-debug.log
2:03:34 PM: ​
2:03:34 PM: “build.command” failed
2:03:34 PM: ────────────────────────────────────────────────────────────────
2:03:34 PM: ​
2:03:34 PM: Error message
2:03:34 PM: Command failed with exit code 1: CI= npm run build
2:03:34 PM: ​
2:03:34 PM: Error location
2:03:34 PM: In Build command from Netlify app:
2:03:34 PM: CI= npm run build
2:03:34 PM: ​
2:03:34 PM: Resolved config
2:03:34 PM: build:
2:03:34 PM: base: /opt/build/repo/frontend
2:03:34 PM: command: CI= npm run build
2:03:34 PM: commandOrigin: ui
2:03:34 PM: environment:
2:03:34 PM: - CI
2:03:34 PM: - GATSBY_STRAPI_URL
2:03:34 PM: - NODE_VERSION
2:03:34 PM: publish: /opt/build/repo/frontend/public
2:03:34 PM: publishOrigin: ui
2:03:34 PM: plugins:
2:03:34 PM: - inputs: {}
2:03:34 PM: origin: ui
2:03:34 PM: package: “atnetlify/plugin-gatsby”
2:03:36 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:03:36 PM: Failing build: Failed to build site
2:03:36 PM: Finished processing build request in 2m6.24s

Hi @joinpoc,

Thanks for reaching out and welcome to Netlify’s Support Forums!

Could you share the site name that you’re trying to deploy on? For example, sitename.netlify.app. This will help us investigate the issue.

Hi Melvin,

Thanks for the response. Site Name: classy-daifuku-787bdf.netlify.app (https://classy-daifuku-787bdf.netlify.app/)

Please note. Application render with same warning in my localhost.

Thank you !

This is probably the actual error, not the one that you shared. A quick Google Search returns this: elasticsearch - child “path” fails because “path” is not allowed to be empty - Stack Overflow.

This doesn’t seem to be a Netlify issue.

Hi @Melvin , Thanks for checking it.

I am able to run the application successfully in localhost. Please find the logs.

There are many warnings or ESlint errors but able to render the application.

Appreciate your support. Thanks.

Log Details below:______________________________
Frontend (dev)
$ npm run develop

gatsby-starter-default@0.1.0 develop D:\Frontend
gatsby develop

internal/modules/cjs/loader.js:1153
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module:
D:\Frontend\node_modules\remark-mdx\index.js
require() of ES modules is not supported.
require() of D:\Frontend\node_modules\remark-mdx\index.js from D:
Frontend\node_modules\gatsby-recipes\dist\graphql-server\server.js
is an ES module file as it is a .js file whose nearest parent package.json
contains “type”: “module” which defines all .js files in that package scope as
ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use
import(), or remove “type”: “module” from
D:\Frontend\node_modules\remark-mdx\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:13)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (D:\Frontend\node_modules\gatsby-recipes

\dist\graphql-server\server.js:52:17)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
code: ‘ERR_REQUIRE_ESM’
}

success open and validate gatsby-configs - 0.150s
success load plugins - 1.551s
success onPreInit - 0.059s
success initialize cache - 0.064s
success copy gatsby files - 0.361s
success onPreBootstrap - 0.056s
success createSchemaCustomization - 0.010s
info Starting to fetch data from Strapi - http://localhost:1337/products with
params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/categories with
params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/variants with
params {“_limit”:1000}
success Fetched Strapi Data - 0.792s
success Checking for changed pages - 0.001s
success source and transform nodes - 1.980s
success building schema - 1.245s
info Total nodes: 184, SitePage nodes: 15 (use --verbose for breakdown)
success createPages - 0.081s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.174s
success update schema - 0.062s
success write out redirect data - 0.003s
success onPostBootstrap - 0.002s
info bootstrap finished - 11.943s
success onPreExtractQueries - 0.001s
success extract queries from components - 2.581s
success write out requires - 0.087s
success run static queries - 0.050s - 4/4 79.47/s
success run page queries - 0.094s - 3/3 31.88/s
warn isModuleDeclaration has been deprecated, please migrate to
isImportOrExportDeclaration
at isModuleDeclaration (D:\JAMStack\ECOM\frontend\node_modules@babel\types
lib\validators\generated\index.js:2748:35)
at PluginPass.Program
(D:\Frontend\node_modules\babel-plugin-lodash\lib\index.js:102:44)

Material-UI: the createMuiTheme function was renamed to createTheme.

info
Hi from the Gatsby maintainers! Based on what we see in your site, these coming
features may help you. All of these can be enabled within gatsby-config.js via
flags (samples below)

Preserve webpack’s Cache (Cache flags · gatsbyjs/gatsby · Discussion #28331 · GitHub),
which changes Gatsby’s cache clearing behavior to not clear webpack’s
cache unless you run “gatsby clean” or delete the .cache folder manually.
Here’s how to try it:

module.exports = {
flags: { PRESERVE_WEBPACK_CACHE: true },
plugins: […]
}


You can now view gatsby-starter-default in the browser.

http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site’s data and schema

http://localhost:8000/___graphql

Note that the development build is not optimized.
To create a production build, use gatsby build

warn ESLintError:
D:\Frontend\src\components\auth\AuthPortal.js
4:8 warning ‘Typography’ is defined but never used

Here is the Netlify log:

2:20:01 PM: warning isModuleDeclaration has been deprecated, please migrate to isImportOrExportDeclaration
2:20:01 PM: at isModuleDeclaration (/opt/build/repo/frontend/node_modules/@babel/types/lib/validators/generated/index.js:2748:35)
2:20:01 PM: at PluginPass.Program (/opt/build/repo/frontend/node_modules/babel-plugin-lodash/lib/index.js:102:44)
2:20:30 PM: failed Building production JavaScript and CSS bundles - 29.122s
2:20:30 PM: Failed to validate error Error [ValidationError]: child “location” fails because [child “start” fails because [“index” is not allowed]]
2:20:30 PM: at Object.exports.process (/opt/build/repo/frontend/node_modules/@hapi/joi/lib/errors.js:202:19)
2:20:30 PM: at internals.Object._validateWithOptions (/opt/build/repo/frontend/node_modules/@hapi/joi/lib/types/any/index.js:763:31)
2:20:30 PM: at internals.Object.validate (/opt/build/repo/frontend/node_modules/@hapi/joi/lib/types/any/index.js:797:21)
2:20:30 PM: at constructError (/opt/build/repo/frontend/node_modules/gatsby-cli/lib/structured-errors/construct-error.js:52:32)
2:20:30 PM: at Reporter.error (/opt/build/repo/frontend/node_modules/gatsby-cli/lib/reporter/reporter.js:135:59)
2:20:30 PM: at /opt/build/repo/frontend/node_modules/gatsby-cli/lib/reporter/reporter.js:123:48
2:20:30 PM: at Array.map ()
2:20:30 PM: at Reporter.error (/opt/build/repo/frontend/node_modules/gatsby-cli/lib/reporter/reporter.js:123:26)
2:20:30 PM: at Reporter.panic (/opt/build/repo/frontend/node_modules/gatsby-cli/lib/reporter/reporter.js:75:34)
2:20:30 PM: at Object.panic (/opt/build/repo/frontend/node_modules/gatsby-cli/lib/reporter/reporter-timer.js:52:23)
2:20:30 PM: at build (/opt/build/repo/frontend/node_modules/gatsby/src/commands/build.ts:146:24) {
2:20:30 PM: isJoi: true,
2:20:30 PM: details: [
2:20:30 PM: {
2:20:30 PM: message: ““index” is not allowed”,
2:20:30 PM: path: [Array],
2:20:30 PM: type: “object.allowUnknown”,
2:20:30 PM: context: [Object]
2:20:30 PM: }
2:20:30 PM: ],
2:20:30 PM: _object: {
2:20:30 PM: context: {
2:20:30 PM: stage: “build-javascript”,
2:20:30 PM: stageLabel: “Generating JavaScript bundles”,
2:20:30 PM: sourceMessage: “/opt/build/repo/frontend/src/pages/using-ssr.js: Unexpected token (30:6)\n” +
2:20:30 PM: “\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 28 |\x1B[39m \x1B[90m// .\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 29 |\x1B[39m \x1B[90m//

\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 30 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33mLink\x1B[39m to\x1B[33m=\x1B[39m\x1B[32m”/“\x1B[39m\x1B[33m>\x1B[39m\x1B[33mGo\x1B[39m back to the homepage\x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLink\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 31 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLayout\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 32 |\x1B[39m )\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 33 |\x1B[39m }\x1B[0m”
2:20:30 PM: },
2:20:30 PM: filePath: “/opt/build/repo/frontend/src/pages/using-ssr.js”,
2:20:30 PM: location: { start: [Position] },
2:20:30 PM: text: “Generating JavaScript bundles failed\n” +
2:20:30 PM: “\n” +
2:20:30 PM: “/opt/build/repo/frontend/src/pages/using-ssr.js: Unexpected token (30:6)\n” +
2:20:30 PM: “\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 28 |\x1B[39m \x1B[90m// .\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 29 |\x1B[39m \x1B[90m//

\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 30 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33mLink\x1B[39m to\x1B[33m=\x1B[39m\x1B[32m”/“\x1B[39m\x1B[33m>\x1B[39m\x1B[33mGo\x1B[39m back to the homepage\x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLink\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 31 |\x1B[39m \x1B[33m<\x1B[39m\x1B[33m/\x1B[39m\x1B[33mLayout\x1B[39m\x1B[33m>\x1B[39m\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 32 |\x1B[39m )\x1B[0m\n” +
2:20:30 PM: “\x1B[0m \x1B[90m 33 |\x1B[39m }\x1B[0m”,
2:20:30 PM: type: “WEBPACK”,
2:20:30 PM: level: “ERROR”,
2:20:30 PM: stack: ,
2:20:30 PM: docsUrl: “How to File an Issue | Gatsby”,
2:20:30 PM: code: “98123”
2:20:30 PM: },
2:20:30 PM: annotate: [Function (anonymous)]
2:20:30 PM: }
2:20:31 PM: ​
2:20:31 PM: “build.command” failed
2:20:31 PM: ────────────────────────────────────────────────────────────────
2:20:31 PM: ​
2:20:31 PM: Error message
2:20:31 PM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
2:20:31 PM: ​
2:20:31 PM: Error location
2:20:31 PM: In Build command from Netlify app:
2:20:31 PM: CI= npm run build
2:20:31 PM: ​
2:20:31 PM: Resolved config
2:20:31 PM: build:
2:20:31 PM: base: /opt/build/repo/frontend

Below one is the local host log

Log Details below:______________________________
Frontend (dev)
$ npm run develop

gatsby-starter-default@0.1.0 develop D:\Frontend
gatsby develop

internal/modules/cjs/loader.js:1153
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module:
D:\Frontend\node_modules\remark-mdx\index.js
require() of ES modules is not supported.
require() of D:\Frontend\node_modules\remark-mdx\index.js from D:
Frontend\node_modules\gatsby-recipes\dist\graphql-server\server.js
is an ES module file as it is a .js file whose nearest parent package.json
contains “type”: “module” which defines all .js files in that package scope as
ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use
import(), or remove “type”: “module” from
D:\Frontend\node_modules\remark-mdx\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:13)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (D:\Frontend\node_modules\gatsby-recipes

\dist\graphql-server\server.js:52:17)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
code: ‘ERR_REQUIRE_ESM’
}

success open and validate gatsby-configs - 0.150s
success load plugins - 1.551s
success onPreInit - 0.059s
success initialize cache - 0.064s
success copy gatsby files - 0.361s
success onPreBootstrap - 0.056s
success createSchemaCustomization - 0.010s
info Starting to fetch data from Strapi - http://localhost:1337/products with
params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/categories with
params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/variants with
params {“_limit”:1000}
success Fetched Strapi Data - 0.792s
success Checking for changed pages - 0.001s
success source and transform nodes - 1.980s
success building schema - 1.245s
info Total nodes: 184, SitePage nodes: 15 (use --verbose for breakdown)
success createPages - 0.081s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.174s
success update schema - 0.062s
success write out redirect data - 0.003s
success onPostBootstrap - 0.002s
info bootstrap finished - 11.943s
success onPreExtractQueries - 0.001s
success extract queries from components - 2.581s
success write out requires - 0.087s
success run static queries - 0.050s - 4/4 79.47/s
success run page queries - 0.094s - 3/3 31.88/s
warn isModuleDeclaration has been deprecated, please migrate to
isImportOrExportDeclaration
at isModuleDeclaration (D:\JAMStack\ECOM\frontend\node_modules@babel\types
lib\validators\generated\index.js:2748:35)
at PluginPass.Program
(D:\Frontend\node_modules\babel-plugin-lodash\lib\index.js:102:44)

Material-UI: the createMuiTheme function was renamed to createTheme.

info
Hi from the Gatsby maintainers! Based on what we see in your site, these coming
features may help you. All of these can be enabled within gatsby-config.js via
flags (samples below)

Preserve webpack’s Cache (Cache flags · gatsbyjs/gatsby · Discussion #28331 · GitHub),
which changes Gatsby’s cache clearing behavior to not clear webpack’s
cache unless you run “gatsby clean” or delete the .cache folder manually.
Here’s how to try it:

module.exports = {
flags: { PRESERVE_WEBPACK_CACHE: true },
plugins: […]
}


You can now view gatsby-starter-default in the browser.

http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site’s data and schema

http://localhost:8000/___graphql

Note that the development build is not optimized.
To create a production build, use gatsby build

warn ESLintError:
D:\Frontend\src\components\auth\AuthPortal.js
4:8 warning ‘Typography’ is defined but never used

######################################

Comparing the two logs could find the error only at Netlify build log not in the local host. Can you please let know how further we can get in to solve this issue. Waiting for the this trial site to get deploy successfully. Netlify please let know how better I best I can use to get the business done on next steps. Thanks.

Your local command is also showing errors. Also, gatsby develop is different from gatsby build. Try running gatsby build locally and see if it works.

Thanks for checking it.

Still banging my head for solution.

Just built with gatsby build. Logs below.

D:\JAMStack\ECOM\frontend>npm run build

gatsby-starter-default@0.1.0 build D:\JAMStack\ECOM\frontend
gatsby build

success open and validate gatsby-configs - 0.217s
success load plugins - 13.004s
success onPreInit - 0.118s
success delete html and css files from previous builds - 0.006s
success initialize cache - 0.014s
success copy gatsby files - 0.386s
success onPreBootstrap - 0.288s
success createSchemaCustomization - 0.010s
info Starting to fetch data from Strapi - http://localhost:1337/products with params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/categories with params {“_limit”:1000}
info Starting to fetch data from Strapi - http://localhost:1337/variants with params {“_limit”:1000}
success Fetched Strapi Data - 0.682s
success Checking for changed pages - 0.003s
success source and transform nodes - 1.766s
success building schema - 1.026s
info Total nodes: 186, SitePage nodes: 15 (use --verbose for breakdown)
success createPages - 0.261s
success Checking for changed pages - 0.007s
success createPagesStatefully - 0.455s
success update schema - 0.068s
success onPreExtractQueries - 0.001s
success extract queries from components - 4.241s
success write out redirect data - 0.020s
success Build manifest and related icons - 0.222s
success onPostBootstrap - 0.233s
info bootstrap finished - 75.342s
success run static queries - 0.049s - 4/4 82.30/s
success run page queries - 0.090s - 25/25 278.75/s
success write out requires - 0.014s
warn isModuleDeclaration has been deprecated, please migrate to isImportOrExportDeclaration
at isModuleDeclaration (D:\JAMStack\ECOM\frontend\node_modules@babel\types\lib\validators\generated\index.js:2748:35)
at PluginPass.Program (D:\JAMStack\ECOM\frontend\node_modules\babel-plugin-lodash\lib\index.js:102:44)
success Building production JavaScript and CSS bundles - 105.004s
success Rewriting compilation hashes - 0.006s
success Building HTML renderer - 21.401s
[ ] 0.001 s 0/25 0% Building static HTML for pages
product-Cuxt
product-Cuxt
product-Cuxt
product-Cuxt
product-Cuxt [
{
node: {
strapiId: ‘63d3d07c0b859c47a48a510c’,
createdAt: ‘2023-01-27T13:24:12.733Z’,
name: ‘GearWrench 68-Piece Mechanics Tool Set’,
id: ‘Product_63d3d07c0b859c47a48a510c’,
description: ‘Features 1/4" and 3/8" SAE and metric Model: 83000’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘63d9354985bac51f189fecc6’,
createdAt: ‘2023-01-31T15:35:37.402Z’,
name: 'Humidifier ',
id: ‘Product_63d9354985bac51f189fecc6’,
description: ‘Humidifiers for Baby Room, 4L Cool Mist Ultrasonic Humidifier’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘63dc200144cc3351dca41149’,
createdAt: ‘2023-02-02T20:41:37.207Z’,
name: 'Circuit Press ',
id: ‘Product_63dc200144cc3351dca41149’,
description: 'The Cricut EasyPress is a heat tool ',
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘6463aaa2e78634282404a72c’,
createdAt: ‘2023-05-16T16:09:06.087Z’,
name: ‘Vimoa 20-Piece Interlocking Garden Edge’,
id: ‘Product_6463aaa2e78634282404a72c’,
description: ‘Interlocking Garden Edge’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘647ba8589511ac2b7088903b’,
createdAt: ‘2023-06-03T20:53:44.825Z’,
name: ‘Clean Clean’,
id: ‘Product_647ba8589511ac2b7088903b’,
description: ‘Clean Cleaner’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘647bab889511ac2b7088903e’,
createdAt: ‘2023-06-03T21:07:20.822Z’,
name: 'Klipsch Denon Home Theater System ',
id: ‘Product_647bab889511ac2b7088903e’,
description: ‘Klipsch Reference R-625FA Dolby Atmos Floorstanding Speaker (Pair) 2x R-41M Bookshelf Home Speaker R-52C Center Channel Home Speaker 2x R-12SW 12" 400W All-Digital Powered Subwoofer 2x Grilles (Installed) 2x Rubber Feet4x Screws Denon AVR-S970H 7.2-Channel 8K Network AV Receiver’,
merchantLink: ‘https://www.adorama.com/kpr625fakb.html?gclid=Cj0KCQjwqs6lBhCxARIsAG8YcDjorKAOGB5qQmYabSBRlKEmPZhMUF_xm8ZsCy-4MbViPhZiiNbRCX0aAn3gEALw_wcB&gclsrc=aw.ds&utm_source=dealsfavoritedotcom’,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘648b74781dd3970484b4d878’,
createdAt: ‘2023-06-15T20:28:40.806Z’,
name: ‘Robi Power Tool’,
id: ‘Product_648b74781dd3970484b4d878’,
description: ‘Power tools’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘648b74c31dd3970484b4d87b’,
createdAt: ‘2023-06-15T20:29:55.451Z’,
name: “Man’s Cross body bag”,
id: ‘Product_648b74c31dd3970484b4d87b’,
description: ‘Cross Bag’,
merchantLink: null,
category: [Object],
variants: [Array]
}
},
{
node: {
strapiId: ‘648d23c1c471582b4495e259’,
createdAt: ‘2023-06-17T03:08:49.790Z’,
name: ‘Body Pillow’,
id: ‘Product_648d23c1c471582b4495e259’,
description: ‘AllSett Health Body Pillow’,
merchantLink: null,
category: [Object],
variants: [Array]
}
}
success Building static HTML for pages - 5.168s - 25/25 4.84/s
success onPostBuild - 0.006s
info Done building in 207.991637 sec