Trying to publish a Gatsby website from Contentful

TypeError: Cannot read property ‘spaceId’ of undefined

-I am trying to publish new content from Contentful.
-I’ve tried changing the webhooks.
-I don’t know much about CI, so please be nice to me! :grinning:

https://jolly-hypatia-28de01.netlify.com/

can you post your build log please? I bet you haven’t set up your environment variables the way contentful needs:

2 Likes

3:34:18 PM: Build ready to start
3:34:20 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
3:34:20 PM: build-image tag: v3.3.7
3:34:20 PM: buildbot version: 11918e084194721d200458438c92ff8180b3b56c
3:34:20 PM: Fetching cached dependencies
3:34:20 PM: Failed to fetch cache, continuing with build
3:34:20 PM: Starting to prepare the repo for build
3:34:21 PM: No cached dependencies found. Cloning fresh repo
3:34:21 PM: git clone GitHub - mdleung/gatsby-blog
3:34:22 PM: Preparing Git Reference refs/heads/master
3:34:22 PM: Found Netlify configuration file netlify.toml in site root
3:34:22 PM: Found Netlify configuration file(s). Overriding site configuration
3:34:22 PM: Starting build script
3:34:22 PM: Installing dependencies
3:34:23 PM: v10.19.0 is already installed.
3:34:24 PM: Now using node v10.19.0 (npm v6.13.4)
3:34:24 PM: Attempting ruby version 2.6.2, read from environment
3:34:25 PM: Using ruby version 2.6.2
3:34:25 PM: Using PHP version 5.6
3:34:25 PM: Started restoring cached node modules
3:34:25 PM: Finished restoring cached node modules
3:34:26 PM: Installing NPM modules using NPM version 6.13.4
3:34:58 PM: > sharp@0.25.2 install /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp
3:34:58 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
3:34:58 PM: info
3:34:58 PM: sharp
3:34:58 PM: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
3:35:00 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/core-js
3:35:00 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
3:35:00 PM: Thank you for using core-js ( GitHub - zloirock/core-js: Standard Library ) for polyfilling JavaScript standard library!
3:35:00 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
3:35:00 PM: > https://opencollective.com/core-js
3:35:00 PM: > https://www.patreon.com/zloirock
3:35:00 PM: Also, the author of core-js ( zloirock (Denis Pushkarev) · GitHub ) is looking for a good job -)
3:35:00 PM: > core-js-pure@3.6.4 postinstall /opt/build/repo/node_modules/core-js-pure
3:35:00 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
3:35:01 PM: > gatsby-telemetry@1.2.1 postinstall /opt/build/repo/node_modules/gatsby-telemetry
3:35:01 PM: > node src/postinstall.js || true
3:35:01 PM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin
3:35:01 PM: > node lib/install.js
3:35:01 PM: :heavy_check_mark: cwebp pre-build test passed successfully
3:35:01 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
3:35:01 PM: > node lib/install.js
3:35:02 PM: :heavy_check_mark: mozjpeg pre-build test passed successfully
3:35:02 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
3:35:02 PM: > node lib/install.js
3:35:02 PM: :heavy_check_mark: pngquant pre-build test passed successfully
3:35:02 PM: > gatsby-cli@2.11.1 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
3:35:02 PM: > node scripts/postinstall.js
3:35:02 PM: > gatsby@2.20.4 postinstall /opt/build/repo/node_modules/gatsby
3:35:02 PM: > node scripts/postinstall.js
3:35:05 PM: npm WARN
3:35:05 PM: optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
3:35:05 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:35:05 PM: npm
3:35:05 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/gatsby/node_modules/fsevents):
3:35:05 PM: npm
3:35:05 PM: WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:35:05 PM: npm
3:35:05 PM: WARN
3:35:05 PM: optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/gatsby-page-utils/node_modules/fsevents):
3:35:05 PM: npm
3:35:05 PM: WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:35:05 PM: npm WARN
3:35:05 PM: optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/chokidar/node_modules/fsevents):
3:35:05 PM: npm WARN
3:35:05 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:35:05 PM: added 2238 packages from 1015 contributors and audited 28157 packages in 38.397s
3:35:07 PM: 76 packages are looking for funding
3:35:07 PM: run npm fund for details
3:35:07 PM: found 29 vulnerabilities (20 low, 9 high)
3:35:07 PM: run npm audit fix to fix them, or npm audit for details
3:35:07 PM: NPM modules installed
3:35:07 PM: Started restoring cached go cache
3:35:07 PM: Finished restoring cached go cache
3:35:07 PM: unset GOOS;
3:35:07 PM: unset GOARCH;
3:35:07 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.12.linux.amd64’;
3:35:07 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}”;
3:35:07 PM: go version >&2;
3:35:07 PM: export GIMME_ENV=‘/opt/buildhome/.gimme/env/go1.12.linux.amd64.env’;
3:35:07 PM: go version go1.12 linux/amd64
3:35:07 PM: Installing missing commands
3:35:07 PM: Verify run directory
3:35:07 PM: Executing user command: gatsby build
3:35:09 PM: error We encountered an error while trying to load your site’s gatsby-config. Please fix the error and try again.
3:35:09 PM:
3:35:09 PM: TypeError: Cannot read property ‘spaceId’ of undefined
3:35:09 PM:
3:35:09 PM: - gatsby-config.js:10 Object.
3:35:09 PM: /opt/build/repo/gatsby-config.js:10:64
3:35:09 PM:
3:35:09 PM: - v8-compile-cache.js:178 Module._compile
3:35:09 PM: [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
3:35:09 PM:
3:35:09 PM: - loader.js:789 Object.Module._extensions…js
3:35:09 PM: internal/modules/cjs/loader.js:789:10
3:35:09 PM:
3:35:09 PM: - loader.js:653 Module.load
3:35:09 PM: internal/modules/cjs/loader.js:653:32
3:35:09 PM:
3:35:09 PM: - loader.js:593 tryModuleLoad
3:35:09 PM: internal/modules/cjs/loader.js:593:12
3:35:09 PM:
3:35:09 PM: - loader.js:585 Function.Module._load
3:35:09 PM: internal/modules/cjs/loader.js:585:3
3:35:09 PM:
3:35:09 PM: - loader.js:692 Module.require
3:35:09 PM: internal/modules/cjs/loader.js:692:17
3:35:09 PM:
3:35:09 PM: - v8-compile-cache.js:159 require
3:35:09 PM: [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
3:35:09 PM:
3:35:09 PM: - get-config-file.js:26 getConfigFile
3:35:09 PM: [repo]/[gatsby]/dist/bootstrap/get-config-file.js:26:20
3:35:09 PM:
3:35:09 PM: - index.js:130 module.exports
3:35:09 PM: [repo]/[gatsby]/dist/bootstrap/index.js:130:13
3:35:09 PM:
3:35:09 PM: - build.js:86 build
3:35:09 PM: [repo]/[gatsby]/dist/commands/build.js:86:13
3:35:09 PM:
3:35:09 PM: - create-cli.js:167 cli.command.handler.getCommandHandler
3:35:09 PM: [repo]/[gatsby]/[gatsby-cli]/lib/create-cli.js:167:14
3:35:09 PM:
3:35:09 PM: - create-cli.js:98 argv
3:35:09 PM: [repo]/[gatsby]/[gatsby-cli]/lib/create-cli.js:98:24
3:35:09 PM:
3:35:09 PM: - create-cli.js:32 Object.args [as handler]
3:35:09 PM: [repo]/[gatsby]/[gatsby-cli]/lib/create-cli.js:32:19
3:35:09 PM:
3:35:09 PM: - command.js:238 Object.runCommand
3:35:09 PM: [repo]/[gatsby]/[yargs]/lib/command.js:238:44
3:35:09 PM:
3:35:09 PM: - yargs.js:1063 Object.parseArgs [as _parseArgs]
3:35:09 PM: [repo]/[gatsby]/[yargs]/yargs.js:1063:30
3:35:09 PM:
3:35:09 PM:
3:35:09 PM: not finished open and validate gatsby-configs - 0.052s
3:35:09 PM: Skipping functions preparation step: no functions directory set
3:35:09 PM: Caching artifacts
3:35:09 PM: Started saving node modules
3:35:09 PM: Finished saving node modules
3:35:09 PM: Started saving pip cache
3:35:09 PM: Finished saving pip cache
3:35:09 PM: Started saving emacs cask dependencies
3:35:09 PM: Finished saving emacs cask dependencies
3:35:09 PM: Started saving maven dependencies
3:35:09 PM: Finished saving maven dependencies
3:35:09 PM: Started saving boot dependencies
3:35:09 PM: Finished saving boot dependencies
3:35:09 PM: Started saving go dependencies
3:35:09 PM: Finished saving go dependencies
3:35:12 PM: Error running command: Build script returned non-zero exit code: 1
3:35:12 PM: Failing build: Failed to build site
3:35:12 PM: failed during stage ‘building site’: Build script returned non-zero exit code: 1
3:35:12 PM: Finished processing build request in 51.929388696s

Yes, you were right.

1 Like

great! glad it’s working :slight_smile: