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.
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//
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