Closed opensourcebangladesh closed 3 years ago
Facing the same error, any solution found?
If you remove site_keywords by leaving the variables empty on the config option in the cms, you get a new error.
TypeError: Cannot read property 'name' of undefined
. See error log below.
> Build error occurred
9:29:47 AM: TypeError: Cannot read property 'name' of undefined
9:29:47 AM: at Index (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:269:39)
9:29:47 AM: at Module.Htzz (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:720:108)
9:29:47 AM: at __webpack_require__ (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:23:31)
9:29:47 AM: at Object.4 (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:448:18)
9:29:47 AM: at __webpack_require__ (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:23:31)
9:29:47 AM: at /opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:91:18
9:29:47 AM: at Object.<anonymous> (/opt/build/repo/.next/server/pages/posts/lorem-ipsum.js:94:10)
9:29:47 AM: at Module._compile (internal/modules/cjs/loader.js:1138:30)
9:29:47 AM: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
9:29:47 AM: at Module.load (internal/modules/cjs/loader.js:986:32) {
9:29:47 AM: type: 'TypeError'
9:29:47 AM: }
9:29:48 AM: npm ERR! code ELIFECYCLE
9:29:48 AM: npm ERR! errno 1
9:29:48 AM: npm ERR! my-app@0.1.1 export: `next build && next export -o ./dist`
9:29:48 AM: npm ERR! Exit status 1
9:29:48 AM: npm ERR!
9:29:48 AM: npm ERR! Failed at the my-app@0.1.1 export script.
9:29:48 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
9:29:48 AM: npm ERR! A complete log of this run can be found in:
9:29:48 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-17T16_29_48_098Z-debug.log
9:29:48 AM:
9:29:48 AM: ────────────────────────────────────────────────────────────────
9:29:48 AM: "build.command" failed
9:29:48 AM: ────────────────────────────────────────────────────────────────
9:29:48 AM:
9:29:48 AM: Error message
9:29:48 AM: Command failed with exit code 1: npm run export
Adding: this happens only with npm run build
both on netlify and locally. The error does not happen with npm run dev
.
I have narrowed down the problem. It happens when you change the name of the author from wutali
to anything else with the CMS. @wutali
Allright it seems that everything is working fine. I can add a new name with the cms and publish a new post. It seems obvious in retrospect that you can not delete, or overwrite an existing author with existing articles. I think that was the source of the error, with get author name wondering where is wutali.
I hope this helps.
@alitarraf Thanks. Also if we delete tags, build throw the 'TypeError: Cannot read property 'name' of undefined'. Make sure delete all posts if you want to.
Deploy Log:
4:07:01 PM: Build ready to start 4:07:02 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849 4:07:02 PM: build-image tag: v3.6.0 4:07:02 PM: buildbot version: e26592b49d9d56b21349effe1b8fab4d50845f11 4:07:03 PM: Building without cache 4:07:03 PM: Starting to prepare the repo for build 4:07:04 PM: No cached dependencies found. Cloning fresh repo 4:07:04 PM: git clone git@github.com:CECUET/CUET 4:07:04 PM: Preparing Git Reference refs/heads/master 4:07:06 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'dist' versus '/' in the Netlify UI 4:07:06 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npm run export' versus '' in the Netlify UI 4:07:06 PM: Starting build script 4:07:06 PM: Installing dependencies 4:07:06 PM: Python version set to 2.7 4:07:07 PM: v12.18.0 is already installed. 4:07:08 PM: Now using node v12.18.0 (npm v6.14.4) 4:07:08 PM: Started restoring cached build plugins 4:07:08 PM: Finished restoring cached build plugins 4:07:08 PM: Attempting ruby version 2.7.1, read from environment 4:07:10 PM: Using ruby version 2.7.1 4:07:10 PM: Using PHP version 5.6 4:07:10 PM: Started restoring cached node modules 4:07:10 PM: Finished restoring cached node modules 4:07:10 PM: Started restoring cached yarn cache 4:07:10 PM: Finished restoring cached yarn cache 4:07:10 PM: Installing yarn at version 1.22.4 4:07:10 PM: Installing Yarn! 4:07:10 PM: > Downloading tarball... 4:07:10 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.6RNVS5SqMN 4:07:10 PM: % Total % Received % Xferd Average Speed Time Time Time Current 4:07:10 PM: Dload Upload Total Spent Left Speed 4:07:10 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 4:07:10 PM: 100 80 100 80 0 0 187 0 --:--:-- --:--:-- --:--:-- 187 4:07:11 PM: 100 93 100 93 0 0 122 0 --:--:-- --:--:-- --:--:-- 122 4:07:11 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 4:07:11 PM: 100 643 100 643 0 0 588 0 0:00:01 0:00:01 --:--:-- 2747 4:07:11 PM: 100 1215k 100 1215k 0 0 797k 0 0:00:01 0:00:01 --:--:-- 797k 4:07:11 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.6RNVS5SqMN.asc 4:07:12 PM: 100 84 100 84 0 0 1704 0 --:--:-- --:--:-- --:--:-- 1704 4:07:12 PM: 100 97 100 97 0 0 1251 0 --:--:-- --:--:-- --:--:-- 1251 4:07:12 PM: 100 647 100 647 0 0 2875 0 --:--:-- --:--:-- --:--:-- 2875 4:07:12 PM: 100 1028 100 1028 0 0 3823 0 --:--:-- --:--:-- --:--:-- 3823 4:07:12 PM: > Verifying integrity... 4:07:12 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA 4:07:12 PM: gpg: Good signature from "Yarn Packaging yarn@dan.cx" 4:07:12 PM: gpg: WARNING: This key is not certified with a trusted signature! 4:07:12 PM: gpg: There is no indication that the signature belongs to the owner. 4:07:12 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310 4:07:12 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA 4:07:12 PM: > GPG signature looks good 4:07:12 PM: > Extracting to ~/.yarn... 4:07:12 PM: > Adding to $PATH... 4:07:12 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the
yarn
command will now be available. 4:07:13 PM: Installing NPM modules using Yarn version 1.22.4 4:07:13 PM: yarn install v1.22.4 4:07:13 PM: [1/4] Resolving packages... 4:07:14 PM: [2/4] Fetching packages... 4:07:33 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module. 4:07:33 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 4:07:33 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module. 4:07:33 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 4:07:33 PM: [3/4] Linking dependencies... 4:07:33 PM: warning " > react-twitter-embed@3.0.3" has unmet peer dependency "prop-types@^15.5.4". 4:07:33 PM: warning "react-twitter-embed > enzyme-adapter-react-16@1.15.3" has unmet peer dependency "enzyme@^3.0.0". 4:07:33 PM: warning " > react-youtube@7.11.3" has unmet peer dependency "@types/youtube@0.0.38". 4:07:43 PM: [4/4] Building fresh packages... 4:07:43 PM: Done in 30.11s. 4:07:43 PM: NPM modules installed using Yarn 4:07:43 PM: Started restoring cached go cache 4:07:43 PM: Finished restoring cached go cache 4:07:43 PM: go version go1.14.4 linux/amd64 4:07:43 PM: go version go1.14.4 linux/amd64 4:07:43 PM: Installing missing commands 4:07:43 PM: Verify run directory 4:07:45 PM: 4:07:45 PM: ──────────────────────────────────────────────────────────────── 4:07:45 PM: Netlify Build4:07:45 PM: ──────────────────────────────────────────────────────────────── 4:07:45 PM: 4:07:45 PM: ❯ Version 4:07:45 PM: @netlify/build 8.0.1 4:07:45 PM: 4:07:45 PM: ❯ Flags 4:07:45 PM: deployId: 5ffad1c5dfa7f2f53f25014e 4:07:45 PM: mode: buildbot 4:07:45 PM: 4:07:45 PM: ❯ Current directory 4:07:45 PM: /opt/build/repo 4:07:45 PM: 4:07:45 PM: ❯ Config file 4:07:45 PM: /opt/build/repo/netlify.toml 4:07:45 PM: 4:07:45 PM: ❯ Context 4:07:45 PM: production 4:07:45 PM: 4:07:45 PM: ──────────────────────────────────────────────────────────────── 4:07:45 PM: 1. build.command from netlify.toml
4:07:45 PM: ──────────────────────────────────────────────────────────────── 4:07:45 PM: 4:07:45 PM: $ npm run export 4:07:46 PM: > my-app@0.1.1 export /opt/build/repo 4:07:46 PM: > next build && next export -o ./dist 4:07:47 PM: Warning: No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache 4:07:47 PM: Creating an optimized production build... 4:07:53 PM: Failed to compile. 4:07:53 PM: 4:07:53 PM: ./src/lib/config.ts:13:16 4:07:53 PM: Type error: Conversion of type '{ base_url: string; site_title: string; site_description: string; site_keywords: string[]; posts_per_page: number; twitter_account: string; github_account: string; }' to type 'Config' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. 4:07:53 PM: Types of property 'site_keywords' are incompatible. 4:07:53 PM: Type 'string[]' is not comparable to type '{ keyword: string; }[]'. 4:07:53 PM: Type 'string' is not comparable to type '{ keyword: string; }'. 4:07:53 PM: 11 | }; 4:07:53 PM: 12 | 4:07:53 PM: > 13 | export default config as Config; 4:07:53 PM: | ^ 4:07:53 PM: 14 | 4:07:53 PM: npm ERR! code ELIFECYCLE 4:07:53 PM: npm ERR! errno 1 4:07:53 PM: npm ERR! my-app@0.1.1 export:
next build && next export -o ./dist
4:07:53 PM: npm ERR! Exit status 1 4:07:53 PM: npm ERR! 4:07:53 PM: npm ERR! Failed at the my-app@0.1.1 export script. 4:07:53 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 4:07:53 PM: npm ERR! A complete log of this run can be found in: 4:07:53 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-01-10T10_07_53_629Z-debug.log 4:07:53 PM: 4:07:53 PM: ──────────────────────────────────────────────────────────────── 4:07:53 PM: "build.command" failed4:07:53 PM: ──────────────────────────────────────────────────────────────── 4:07:53 PM: 4:07:53 PM: Error message 4:07:53 PM: Command failed with exit code 1: npm run export 4:07:53 PM: 4:07:53 PM: Error location 4:07:53 PM: In build.command from netlify.toml: 4:07:53 PM: npm run export 4:07:53 PM: 4:07:53 PM: Resolved config 4:07:53 PM: build: 4:07:53 PM: command: npm run export 4:07:53 PM: commandOrigin: config 4:07:53 PM: publish: /opt/build/repo/dist 4:07:53 PM: Caching artifacts 4:07:53 PM: Started saving node modules 4:07:53 PM: Finished saving node modules 4:07:53 PM: Started saving build plugins 4:07:53 PM: Finished saving build plugins 4:07:53 PM: Started saving yarn cache 4:07:53 PM: Finished saving yarn cache 4:07:53 PM: Started saving pip cache 4:07:53 PM: Finished saving pip cache 4:07:53 PM: Started saving emacs cask dependencies 4:07:53 PM: Finished saving emacs cask dependencies 4:07:53 PM: Started saving maven dependencies 4:07:53 PM: Finished saving maven dependencies 4:07:53 PM: Started saving boot dependencies 4:07:53 PM: Finished saving boot dependencies 4:07:53 PM: Started saving rust rustup cache 4:07:54 PM: Finished saving rust rustup cache 4:07:54 PM: Started saving rust cargo bin cache 4:07:54 PM: Finished saving rust cargo bin cache 4:07:54 PM: Started saving go dependencies 4:07:54 PM: Finished saving go dependencies 4:07:56 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 4:07:56 PM: Failing build: Failed to build site 4:07:56 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 4:07:56 PM: Finished processing build request in 53.793577734