iammatthias / com

Digital garden built using Astro, Obsidian, and other goodies.
https://iammatthias.com
216 stars 36 forks source link

"TypeError: Cannot read property 'path' of undefined" on build in Netlify #25

Closed iammatthias closed 5 years ago

iammatthias commented 5 years ago

Error occurs during build. Log output below.

9:13:17 PM: Build ready to start
9:13:20 PM: build-image version: 84aca9ba39e0ee86ba194760fbfc51a808f62543
9:13:20 PM: buildbot version: 57d44fd1631cc3fff8b38fbaf88d3d04f946418a
9:13:20 PM: Fetching cached dependencies
9:13:20 PM: Starting to download cache of 254.7KB
9:13:20 PM: Finished downloading cache in 90.065157ms
9:13:20 PM: Starting to extract cache
9:13:20 PM: Failed to fetch cache, continuing with build
9:13:20 PM: Starting to prepare the repo for build
9:13:20 PM: No cached dependencies found. Cloning fresh repo
9:13:20 PM: git clone https://github.com/iammatthias/net
9:13:22 PM: Preparing Git Reference pull/22/head
9:13:23 PM: Starting build script
9:13:23 PM: Installing dependencies
9:13:23 PM: Attempting node version 'v10.13.0' from .nvmrc
9:13:24 PM: Downloading and installing node v10.13.0...
9:13:24 PM: Downloading https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz...
9:13:24 PM:   1.1%
9:13:24 PM: 
#####################
9:13:24 PM:                          30.2%
9:13:24 PM: 
#################################################
9:13:24 PM: #############            86.2%
9:13:24 PM: 
######################################################################## 100.0%
9:13:24 PM: Computing checksum with sha256sum
9:13:25 PM: Checksums matched!
9:13:27 PM: Now using node v10.13.0 (npm v6.4.1)
9:13:27 PM: Attempting ruby version 2.3.6, read from environment
9:13:29 PM: Using ruby version 2.3.6
9:13:29 PM: Using PHP version 5.6
9:13:29 PM: Started restoring cached node modules
9:13:29 PM: Finished restoring cached node modules
9:13:29 PM: Started restoring cached yarn cache
9:13:29 PM: Finished restoring cached yarn cache
9:13:29 PM: Installing yarn at version 1.3.2
9:13:29 PM: Installing Yarn!
9:13:29 PM: > Downloading tarball...
9:13:29 PM: [1/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz --> /tmp/yarn.tar.gz.FpXYkGVO3U
9:13:29 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
9:13:29 PM:                                  Dload  Upload   Total   Spent    Left  Speed
9:13:29 PM: 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:13:29 PM: 
100    91  100    91    0     0    632      0 --:--:-- --:--:-- --:--:--   636
9:13:29 PM: 
  0     0    0   608    0     0   1709      0 --:--:-- --:--:-- --:--:--
9:13:29 PM:   1709
9:13:30 PM: 
  2  865k    2 24924    0     0  41974      0  0:00:21 -
9:13:30 PM: -:--:--  0:00:21 41974
9:13:30 PM: 
100  865k  100  865k    0     0  1192k      0 --:--:-- --:--:-
9:13:30 PM: - --:--:-- 6422k
9:13:30 PM: [2/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz.asc --> /tmp/yarn.tar.gz.FpXYkGVO3U.asc
9:13:30 PM: 
100    95  100    95    0     0   1919      0 --:--:-- --:--:--
9:13:30 PM: --:--:--  1919
9:13:30 PM: 
  0     0    0   612    0     0   3935      0 --:--:-- --:--:-- --:--:--  3935
9:13:30 PM: 
100  1027  100  1027    0     0   5149      0 --:--:-- --:--:-- --:--:--  5149
9:13:30 PM: > Verifying integrity...
9:13:30 PM: gpg: Signature made Thu 02 Nov 2017 04:44:10 PM UTC using RSA key ID FD2497F5
9:13:30 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
9:13:30 PM: gpg: Note: This key has expired!
9:13:30 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
9:13:30 PM:      Subkey fingerprint: 6A01 0C51 6600 6599 AA17  F081 46C2 130D FD24 97F5
9:13:30 PM: > GPG signature looks good
9:13:30 PM: > Extracting to ~/.yarn...
9:13:30 PM: > Adding to $PATH...
9:13:30 PM: > We've added the following to your /opt/buildhome/.profile
9:13:30 PM: > If this isn't the profile of your current shell then please add the following to your correct profile:
9:13:30 PM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
9:13:30 PM: 
9:13:31 PM: > Successfully installed Yarn 1.3.2! Please open another terminal where the `yarn` command will now be available.
9:13:31 PM: Installing NPM modules using Yarn version 1.3.2
9:13:32 PM: yarn install v1.3.2
9:13:32 PM: (node:1332) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
9:13:32 PM: [1/4] Resolving packages...
9:13:33 PM: [2/4] Fetching packages...
9:13:55 PM: info fsevents@1.2.7: The platform "linux" is incompatible with this module.
9:13:55 PM: info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
9:13:55 PM: [3/4] Linking dependencies...
9:13:55 PM: warning "gatsby > mini-css-extract-plugin > schema-utils > ajv-errors@1.0.1" has unmet peer dependency "ajv@>=5.0.0".
9:13:55 PM: warning "gatsby-plugin-flow > @babel/preset-flow@7.0.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:13:56 PM: warning "gatsby-plugin-flow > @babel/preset-flow > @babel/plugin-transform-flow-strip-types@7.2.3" has unmet peer dependency "@babel/core@^7.0.0-0".
9:13:56 PM: warning "gatsby-plugin-flow > @babel/preset-flow > @babel/plugin-transform-flow-strip-types > @babel/plugin-syntax-flow@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
9:13:56 PM: warning "gatsby-plugin-netlify > webpack-assets-manifest@3.1.1" has unmet peer dependency "webpack@>=4.4.0".
9:13:56 PM: warning "react-images > react-scrolllock@1.0.9" has incorrect peer dependency "react@^0.14 || ^15.0".
9:13:56 PM: warning "react-images > react-view-pager@0.6.0" has unmet peer dependency "prop-types@^15.5.8".
9:13:56 PM: warning " > react-ionicons@2.1.6" has unmet peer dependency "browserify-css@0.12.0".
9:13:56 PM: warning "stylelint > postcss-html@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
9:13:56 PM: warning "stylelint > postcss-jsx@0.35.0" has unmet peer dependency "postcss@>=5.0.0".
9:13:56 PM: warning "stylelint > postcss-markdown@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
9:13:56 PM: warning "stylelint > postcss-styled@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
9:13:56 PM: warning "stylelint > postcss-syntax@0.34.0" has unmet peer dependency "postcss@>=5.0.0".
9:14:05 PM: [4/4] Building fresh packages...
9:14:09 PM: Done in 36.92s.
9:14:09 PM: NPM modules installed using Yarn
9:14:09 PM: (node:1445) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
9:14:09 PM: Started restoring cached go cache
9:14:09 PM: Finished restoring cached go cache
9:14:09 PM: unset GOOS;
9:14:09 PM: unset GOARCH;
9:14:09 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64';
9:14:09 PM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
9:14:09 PM: go version >&2;
9:14:09 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env';
9:14:09 PM: go version go1.10 linux/amd64
9:14:09 PM: Installing missing commands
9:14:09 PM: Verify run directory
9:14:09 PM: Executing user command: yarn build
9:14:10 PM: yarn run v1.3.2
9:14:10 PM: (node:1498) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
9:14:10 PM: $ gatsby info && gatsby build
9:14:11 PM:   System:
9:14:11 PM:     OS: Linux 4.14 Ubuntu 14.04.5 LTS, Trusty Tahr
9:14:11 PM:     CPU: (8) x64 Intel(R) Xeon(R) CPU @ 2.30GHz
9:14:11 PM:     Shell: 4.3.11 - /bin/bash
9:14:11 PM:   Binaries:
9:14:11 PM:     Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
9:14:11 PM:     Yarn: 1.3.2 - /opt/build/cache/yarn/bin/yarn
9:14:11 PM:     npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
9:14:11 PM:   Languages:
9:14:11 PM:     Python: 2.7.6 - /opt/buildhome/python2.7/bin/python
9:14:11 PM:   npmPackages:
9:14:11 PM:     gatsby: ^2.0.0-rc.13 => 2.0.106
9:14:11 PM:     gatsby-image: ^2.0.0-rc.4 => 2.0.29
9:14:11 PM:     gatsby-plugin-canonical-urls: ^2.0.0-rc.2 => 2.0.9
9:14:11 PM:     gatsby-plugin-catch-links: ^2.0.2 => 2.0.9
9:14:11 PM:     gatsby-plugin-feed: 2.0.9 => 2.0.9
9:14:11 PM:     gatsby-plugin-flow: ^1.0.2 => 1.0.2
9:14:11 PM:     gatsby-plugin-google-analytics: ^2.0.0-rc.2 => 2.0.12
9:14:11 PM:     gatsby-plugin-manifest: 2.0.7 => 2.0.7
9:14:11 PM:     gatsby-plugin-netlify: ^2.0.0-rc.2 => 2.0.7
9:14:11 PM:     gatsby-plugin-nprogress: 2.0.6 => 2.0.6
9:14:11 PM:     gatsby-plugin-offline: ^2.0.0-rc.4 => 2.0.22
9:14:11 PM:     gatsby-plugin-react-helmet: 3.0.1 => 3.0.1
9:14:11 PM:     gatsby-plugin-sitemap: ^2.0.0-rc.2 => 2.0.4
9:14:11 PM:     gatsby-plugin-styled-components: ^3.0.4 => 3.0.4
9:14:11 PM:     gatsby-plugin-typography: 2.2.1 => 2.2.1
9:14:11 PM:     gatsby-remark-images-contentful: ^2.0.0-rc.6 => 2.0.6
9:14:11 PM:     gatsby-remark-prismjs: 3.0.3 => 3.0.3
9:14:11 PM:     gatsby-source-contentful: ^2.0.1-rc.4 => 2.0.28
9:14:12 PM:     gatsby-source-filesystem: ^2.0.1-rc.2 => 2.0.18
9:14:12 PM:     gatsby-transformer-remark: ^2.1.1-rc.5 => 2.2.2
9:14:13 PM: success open and validate gatsby-configs — 0.013 s
9:14:14 PM: success load plugins — 0.370 s
9:14:14 PM: success onPreInit — 0.660 s
9:14:14 PM: success delete html and css files from previous builds — 0.007 s
9:14:14 PM: success initialize cache — 0.010 s
9:14:14 PM: success copy gatsby files — 0.031 s
9:14:14 PM: success onPreBootstrap — 0.019 s
9:14:15 PM: Starting to fetch data from Contentful
9:14:15 PM: Fetching default locale
9:14:15 PM: default locale is : en-US
9:14:15 PM: contentTypes fetched 7
9:14:15 PM: Updated entries  59
9:14:15 PM: Deleted entries  0
9:14:15 PM: Updated assets  604
9:14:15 PM: Deleted assets  0
9:14:15 PM: Fetch Contentful data: 724.317ms
9:14:16 PM: success source and transform nodes — 1.285 s
9:14:16 PM: success building schema — 0.590 s
9:14:16 PM: success createPages — 0.095 s
9:14:17 PM: success createPagesStatefully — 0.140 s
9:14:17 PM: success onPreExtractQueries — 0.005 s
9:14:17 PM: success update schema — 0.437 s
9:14:17 PM: success extract queries from components — 0.210 s
9:14:19 PM: success run graphql queries — 2.196 s — 40/40 18.22 queries/second
9:14:19 PM: success write out page data — 0.005 s
9:14:19 PM: success write out redirect data — 0.001 s
9:14:20 PM: done generating icons for manifest
9:14:20 PM: success onPostBootstrap — 0.305 s
9:14:20 PM: info bootstrap finished - 8.702 s
9:14:53 PM: success Building production JavaScript and CSS bundles — 33.539 s
9:14:57 PM: error Cannot read property 'path' of undefined
9:14:57 PM: 
9:14:57 PM:   TypeError: Cannot read property 'path' of undefined
9:14:57 PM:   
9:14:57 PM:   - build.js:68 buildHTML.catch.err
9:14:57 PM:     [repo]/[gatsby]/dist/commands/build.js:68:72
9:14:57 PM:   
9:14:57 PM:   - util.js:16 tryCatcher
9:14:57 PM:     [repo]/[bluebird]/js/release/util.js:16:23
9:14:57 PM:   
9:14:57 PM:   - promise.js:512 Promise._settlePromiseFromHandler
9:14:57 PM:     [repo]/[bluebird]/js/release/promise.js:512:31
9:14:57 PM:   
9:14:57 PM:   - promise.js:569 Promise._settlePromise
9:14:57 PM:     [repo]/[bluebird]/js/release/promise.js:569:18
9:14:57 PM:   
9:14:57 PM:   - promise.js:614 Promise._settlePromise0
9:14:57 PM:     [repo]/[bluebird]/js/release/promise.js:614:10
9:14:57 PM:   
9:14:57 PM:   - promise.js:690 Promise._settlePromises
9:14:57 PM:     [repo]/[bluebird]/js/release/promise.js:690:18
9:14:57 PM:   
9:14:57 PM:   - async.js:138 _drainQueueStep
9:14:57 PM:     [repo]/[bluebird]/js/release/async.js:138:12
9:14:57 PM:   
9:14:57 PM:   - async.js:131 _drainQueue
9:14:57 PM:     [repo]/[bluebird]/js/release/async.js:131:9
9:14:57 PM:   
9:14:57 PM:   - async.js:147 Async._drainQueues
9:14:57 PM:     [repo]/[bluebird]/js/release/async.js:147:5
9:14:57 PM:   
9:14:57 PM:   - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
9:14:57 PM:     [repo]/[bluebird]/js/release/async.js:17:14
9:14:57 PM:   
9:14:57 PM: 
9:14:57 PM: error Command failed with exit code 1.
9:14:58 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
9:14:58 PM: Caching artifacts
9:14:58 PM: Started saving node modules
9:14:58 PM: Finished saving node modules
9:14:58 PM: Started saving yarn cache
9:14:58 PM: Finished saving yarn cache
9:14:58 PM: Started saving pip cache
9:14:58 PM: Finished saving pip cache
9:14:58 PM: Started saving emacs cask dependencies
9:14:58 PM: Finished saving emacs cask dependencies
9:14:58 PM: Started saving maven dependencies
9:14:58 PM: Finished saving maven dependencies
9:14:58 PM: Started saving boot dependencies
9:14:58 PM: Finished saving boot dependencies
9:14:58 PM: Started saving go dependencies
9:14:58 PM: Finished saving go dependencies
9:14:58 PM: Cached node version v10.13.0
9:14:58 PM: Error running command: Build script returned non-zero exit code: 1
9:14:58 PM: Failing build: Failed to build site
9:14:58 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
9:14:58 PM: Finished processing build request in 1m38.444547757s
iammatthias commented 5 years ago

Related to the SSR rendering bug in React-Images v1 https://github.com/jossmac/react-images/issues/199

iammatthias commented 5 years ago

I dropped the following into my gatsby-node file, and the page is building now.

exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
  if (stage === 'build-html') {
    actions.setWebpackConfig({
      module: {
        rules: [
          {
            test: /react-images/,
            use: loaders.null(),
          },
        ],
      },
    })
  }
}