question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploy to netlify fails

See original GitHub issue

below is the readout of the netlify deploy log that fails as of 11/25/2020

7:56:15 PM: Build ready to start 7:56:17 PM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41 7:56:17 PM: build-image tag: v3.5.0 7:56:17 PM: buildbot version: 8df8a50b1177b0b57364d20e0ea150448924cebf 7:56:17 PM: Fetching cached dependencies 7:56:17 PM: Failed to fetch cache, continuing with build 7:56:17 PM: Starting to prepare the repo for build 7:56:18 PM: No cached dependencies found. Cloning fresh repo 7:56:18 PM: git clone https://github.com/chec/commercejs-nextjs-demo-store 7:56:19 PM: Preparing Git Reference refs/heads/master 7:56:21 PM: Starting build script 7:56:21 PM: Installing dependencies 7:56:21 PM: Python version set to 2.7 7:56:22 PM: v12.18.0 is already installed. 7:56:23 PM: Now using node v12.18.0 (npm v6.14.4) 7:56:23 PM: Started restoring cached build plugins 7:56:23 PM: Finished restoring cached build plugins 7:56:23 PM: Attempting ruby version 2.7.1, read from environment 7:56:25 PM: Using ruby version 2.7.1 7:56:25 PM: Using PHP version 5.6 7:56:25 PM: Started restoring cached node modules 7:56:25 PM: Finished restoring cached node modules 7:56:25 PM: Started restoring cached yarn cache 7:56:25 PM: Finished restoring cached yarn cache 7:56:25 PM: Installing yarn at version 1.22.4 7:56:25 PM: Installing Yarn! 7:56:25 PM: > Downloading tarball... 7:56:25 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.c5tB7SpjvZ 7:56:25 PM: % Total % Received % Xferd Average Speed Time Time Time Current 7:56:25 PM: Dload Upload Total Spent Left Speed 7:56:26 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 7:56:26 PM: 100 80 100 80 0 0 240 0 --:--:-- --:--:-- --:--:-- 241 7:56:26 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 7:56:26 PM: 100 93 100 93 0 0 136 0 --:--:-- --:--:-- --:--:-- 543 7:56:26 PM: 100 643 100 643 0 0 647 0 --:--:-- --:--:-- --:--:-- 647 7:56:27 PM: 100 1215k 100 1215k 0 0 847k 0 0:00:01 0:00:01 --:--:-- 847k 7:56:27 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.c5tB7SpjvZ.asc 7:56:27 PM: 0 84 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 7:56:27 PM: 100 84 100 84 0 0 2971 0 --:--:-- --:--:-- --:--:-- 84000 7:56:27 PM: 100 97 100 97 0 0 1731 0 --:--:-- --:--:-- --:--:-- 1731 7:56:27 PM: 100 647 100 647 0 0 3736 0 --:--:-- --:--:-- --:--:-- 3736 7:56:27 PM: 100 1028 100 1028 0 0 4756 0 --:--:-- --:--:-- --:--:-- 4756 7:56:27 PM: > Verifying integrity... 7:56:27 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA 7:56:27 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>" 7:56:27 PM: gpg: WARNING: This key is not certified with a trusted signature! 7:56:27 PM: gpg: There is no indication that the signature belongs to the owner. 7:56:27 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310 7:56:27 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA 7:56:27 PM: > GPG signature looks good 7:56:27 PM: > Extracting to ~/.yarn... 7:56:27 PM: > Adding to $PATH... 7:56:27 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarncommand will now be available. 7:56:28 PM: Installing NPM modules using Yarn version 1.22.4 7:56:28 PM: yarn install v1.22.4 7:56:29 PM: [1/4] Resolving packages... 7:56:29 PM: [2/4] Fetching packages... 7:56:30 PM: warning mini-css-extract-plugin@0.4.3: Invalid bin field for "mini-css-extract-plugin". 7:56:49 PM: info fsevents@1.2.12: The platform "linux" is incompatible with this module. 7:56:49 PM: info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation. 7:56:49 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module. 7:56:49 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation. 7:56:49 PM: [3/4] Linking dependencies... 7:56:49 PM: warning "@zeit/next-sass > sass-loader@6.0.6" has unmet peer dependency "webpack@^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0". 7:56:49 PM: warning "@zeit/next-sass > @zeit/next-css > css-loader@1.0.0" has unmet peer dependency "webpack@^4.0.0". 7:56:49 PM: warning "@zeit/next-sass > @zeit/next-css > mini-css-extract-plugin@0.4.3" has unmet peer dependency "webpack@^4.4.0". 7:56:49 PM: warning "@typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "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". 7:57:01 PM: [4/4] Building fresh packages... 7:57:05 PM: Done in 36.23s. 7:57:05 PM: NPM modules installed using Yarn 7:57:05 PM: Started restoring cached go cache 7:57:05 PM: Finished restoring cached go cache 7:57:05 PM: go version go1.14.4 linux/amd64 7:57:05 PM: go version go1.14.4 linux/amd64 7:57:05 PM: Installing missing commands 7:57:05 PM: Verify run directory 7:57:07 PM: ​ 7:57:07 PM: ──────────────────────────────────────────────────────────────── 7:57:07 PM: Netlify Build 7:57:07 PM: ──────────────────────────────────────────────────────────────── 7:57:07 PM: ​ 7:57:07 PM: ❯ Version 7:57:07 PM: @netlify/build 5.3.3 7:57:07 PM: ​ 7:57:07 PM: ❯ Flags 7:57:07 PM: deployId: 5fbf275ffd7259c4ef75ab69 7:57:07 PM: mode: buildbot 7:57:07 PM: ​ 7:57:07 PM: ❯ Current directory 7:57:07 PM: /opt/build/repo 7:57:07 PM: ​ 7:57:07 PM: ❯ Config file 7:57:07 PM: /opt/build/repo/netlify.toml 7:57:07 PM: ​ 7:57:07 PM: ❯ Context 7:57:07 PM: production 7:57:07 PM: ​ 7:57:07 PM: ❯ Loading plugins 7:57:07 PM: - netlify-plugin-onboarding@1.0.0 from netlify.toml and package.json 7:57:08 PM: ​ 7:57:08 PM: ──────────────────────────────────────────────────────────────── 7:57:08 PM: 1. onPreBuild command from netlify-plugin-onboarding 7:57:08 PM: ──────────────────────────────────────────────────────────────── 7:57:08 PM: ​ 7:57:08 PM: Cloning into '/opt/build/repo/node_modules/netlify-plugin-onboarding/template'... 7:57:20 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/netlify-plugin-onboarding/template/node_modules/core-js 7:57:20 PM: > node -e "try{require('./postinstall')}catch(e){}" 7:57:20 PM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/netlify-plugin-onboarding/template/node_modules/ejs 7:57:20 PM: > node ./postinstall.js 7:57:20 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents): 7:57:20 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 7:57:20 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents): 7:57:20 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 7:57:20 PM: added 528 packages from 405 contributors and audited 533 packages in 11.34s 7:57:21 PM: 6 packages are looking for funding 7:57:21 PM: runnpm fundfor details 7:57:21 PM: found 9 vulnerabilities (7 low, 2 high) 7:57:21 PM: runnpm audit fixto fix them, ornpm audit` for details 7:57:21 PM: > example-onboarding-flow@1.0.0 build /opt/build/repo/node_modules/netlify-plugin-onboarding/template 7:57:21 PM: > eleventy --input src --output dist 7:57:22 PM: Writing dist/index.html from ./src/index.md. 7:57:22 PM: Wrote 1 file in 0.12 seconds (v0.11.0) 7:57:22 PM: ​ 7:57:22 PM: (netlify-plugin-onboarding onPreBuild completed in 13.8s) 7:57:22 PM: ​ 7:57:22 PM: ──────────────────────────────────────────────────────────────── 7:57:22 PM: 2. build.command from netlify.toml
7:57:22 PM: ──────────────────────────────────────────────────────────────── 7:57:22 PM: ​ 7:57:22 PM: $ yarn deploy 7:57:22 PM: yarn run v1.22.4 7:57:22 PM: $ next build && next export 7:57:23 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache 7:57:23 PM: info - Creating an optimized production build… 7:57:23 PM: Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected. 7:57:23 PM: See here for more info: https://err.sh/next.js/built-in-css-disabled 7:58:01 PM: info - Compiled successfully 7:58:01 PM: info - Collecting page data… 7:58:01 PM: ⚠️ Invalid public key given to Commerce.js client 7:58:01 PM: ⚠️ Invalid public key given to Commerce.js client 7:58:01 PM: > Build error occurred 7:58:01 PM: TypeError: Cannot read property β€˜toLowerCase’ of undefined 7:58:01 PM: at new e (/opt/build/repo/node_modules/@chec/commerce.js/lib/index.js:1:17032) 7:58:01 PM: at Object.oKQX (/opt/build/repo/.next/server/pages/_app.js:726:58) 7:58:01 PM: at webpack_require (/opt/build/repo/.next/server/pages/_app.js:23:31) 7:58:01 PM: at Module.1TCz (/opt/build/repo/.next/server/pages/_app.js:296:16) 7:58:01 PM: at webpack_require (/opt/build/repo/.next/server/pages/_app.js:23:31) 7:58:01 PM: at Object.0 (/opt/build/repo/.next/server/pages/_app.js:99:18) 7:58:01 PM: at webpack_require (/opt/build/repo/.next/server/pages/_app.js:23:31) 7:58:01 PM: at /opt/build/repo/.next/server/pages/_app.js:91:18 7:58:01 PM: at Object.<anonymous> (/opt/build/repo/.next/server/pages/_app.js:94:10) 7:58:01 PM: at Module._compile (internal/modules/cjs/loader.js:1138:30) 7:58:01 PM: at Object.Module._extensions…js (internal/modules/cjs/loader.js:1158:10) 7:58:01 PM: at Module.load (internal/modules/cjs/loader.js:986:32) 7:58:01 PM: at Function.Module._load (internal/modules/cjs/loader.js:879:14) 7:58:01 PM: at Module.require (internal/modules/cjs/loader.js:1026:19) 7:58:01 PM: at require (internal/modules/cjs/helpers.js:72:18) 7:58:01 PM: at hasCustomGetInitialProps (/opt/build/repo/node_modules/next/dist/build/utils.js:24:1064) 7:58:01 PM: error Command failed with exit code 1. 7:58:01 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 7:58:01 PM: ​ 7:58:01 PM: ──────────────────────────────────────────────────────────────── 7:58:01 PM: β€œbuild.command” failed
7:58:01 PM: ──────────────────────────────────────────────────────────────── 7:58:01 PM: ​ 7:58:01 PM: Error message 7:58:01 PM: Command failed with exit code 1: yarn deploy 7:58:01 PM: ​ 7:58:01 PM: Error location 7:58:01 PM: In build.command from netlify.toml: 7:58:01 PM: yarn deploy 7:58:01 PM: ​ 7:58:01 PM: Resolved config 7:58:01 PM: build: 7:58:01 PM: command: yarn deploy 7:58:01 PM: commandOrigin: config 7:58:01 PM: publish: /opt/build/repo/out 7:58:01 PM: plugins: 7:58:01 PM: - inputs: {} 7:58:01 PM: origin: config 7:58:01 PM: package: netlify-plugin-onboarding 7:58:01 PM: Caching artifacts 7:58:01 PM: Started saving node modules 7:58:01 PM: Finished saving node modules 7:58:01 PM: Started saving build plugins 7:58:01 PM: Finished saving build plugins 7:58:01 PM: Started saving yarn cache 7:58:01 PM: Finished saving yarn cache 7:58:01 PM: Started saving pip cache 7:58:01 PM: Finished saving pip cache 7:58:01 PM: Started saving emacs cask dependencies 7:58:01 PM: Finished saving emacs cask dependencies 7:58:01 PM: Started saving maven dependencies 7:58:01 PM: Finished saving maven dependencies 7:58:01 PM: Started saving boot dependencies 7:58:01 PM: Finished saving boot dependencies 7:58:01 PM: Started saving go dependencies 7:58:01 PM: Finished saving go dependencies 7:58:04 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 7:58:04 PM: Failing build: Failed to build site 7:58:05 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2 7:58:05 PM: Finished processing build request in 1m47.568102991s

Docs
Pricing
Support
News
Terms

Β© 2020 Netlify`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
C3PablOcommented, Mar 4, 2021

Ok, I was following the step by step guide here: https://www.netlify.com/blog/2020/07/09/create-a-fully-fledged-jamstack-commerce-store-with-commerce.js-and-netlify/

and there is something wrong at the step of setting the public key in netlify.toml. It says CHEC_PUBLIC_KEY where it should be NEXT_PUBLIC_CHEC_PUBLIC_KEY

0reactions
jaepasscommented, Mar 4, 2021

Hey there, thanks for pointing this out. We’ll be updating the Netlify blog post! The project README has the most up-to-date project set up if you want to refer to it as well where Netlify blog post has a more thorough step by step walk-through tutorial.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Support Guide] Frequently encountered problems during builds
If a build fails, it's worth retrying with a cleared build cache to see if this works better. You can do this by...
Read more >
Deploy failed Netlify - Stack Overflow
A workaround is removing /build from your .gitignore and then removing the build command (yarn build or npm run build) from the build...
Read more >
2 ways to overcome deployment problems with React on Netlify
Solution 2: Make changes in your deployment setting on Netlify directly: In Netlify open "Site details" - Build & deploy - Environment -Β ......
Read more >
How to Deploy a React Router App to Netlify and Fix the ...
Have you ever experienced a β€œPAGE NOT FOUND” error when trying to access or refresh an application that uses React Router?
Read more >
Netlify Deployment fails - Show & Tell - RedwoodJS Community
I'd also suggest trying to clear the cache when triggering a Netlify build. Maybe there are some artifacts from prior builds to clean...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found