Netlify not generating all index.html files for Gridsome build

Site name: joco-gridsome.netlify.app

Issue: Netlify doesn’t seem to be generating all the index.html files that it should on deploy. (My build command is gridsome build.)

Specifically, when visiting the projects page, and then clicking through to any specific project page, the result is a 404.

I found the troubleshooting guide, and verified that indeed, the index.html files for individual project are missing. However, the weird thing is, they’re only missing on Netlify deploys.

The project links work locally (whether using gridsome develop or netlify dev); they are also generated properly if I use gridsome build and view the files locally, or even if I deploy to Now. For some reason, something about my deploy doesn’t work specifically on Netlify, where it only generates 44 HTML files instead of the 63 generated both on my machine and on Now hosting.

Build logs enclosed; hopefully somebody can point me in the right direction. I’d rather host here. :slight_smile: Thanks in advance!

EDIT: I thought it may have been the error in the below logs, but I removed the code generating it and still no dice. For some reason, the gridsome build command spits out 63 HTML files locally and on Now, but only 44 here on Netlify. Incidentally, Netlify is also processing many fewer images.

5:04:23 PM: Build ready to start
5:04:25 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
5:04:25 PM: build-image tag: v3.3.7
5:04:25 PM: buildbot version: d305548225ac57bb00eb5a596b0b8674e76a4681
5:04:25 PM: Fetching cached dependencies
5:04:25 PM: Starting to download cache of 254.9KB
5:04:25 PM: Finished downloading cache in 69.611292ms
5:04:25 PM: Starting to extract cache
5:04:25 PM: Failed to fetch cache, continuing with build
5:04:25 PM: Starting to prepare the repo for build
5:04:26 PM: No cached dependencies found. Cloning fresh repo
5:04:26 PM: git clone https://github.com/josh-collinsworth/joco-gridsome
5:04:28 PM: Preparing Git Reference refs/heads/master
5:04:29 PM: Found Netlify configuration file netlify.toml in site root
5:04:29 PM: Found Netlify configuration file(s). Overriding site configuration
5:04:29 PM: Starting build script
5:04:29 PM: Installing dependencies
5:04:30 PM: Downloading and installing node v10.20.1...
5:04:30 PM: Downloading https://nodejs.org/dist/v10.20.1/node-v10.20.1-linux-x64.tar.xz...
5:04:31 PM: 
#################################
5:04:31 PM:                                 46.9%
5:04:31 PM: 
###########
5:04:31 PM: #################################################              83.9%
5:04:31 PM: 
#################################################
5:04:31 PM: ####################### 100.0%
5:04:31 PM: Computing checksum with sha256sum
5:04:31 PM: Checksums matched!
5:04:33 PM: Now using node v10.20.1 (npm v6.14.4)
5:04:33 PM: Attempting ruby version 2.6.2, read from environment
5:04:35 PM: Using ruby version 2.6.2
5:04:35 PM: Using PHP version 5.6
5:04:35 PM: Started restoring cached node modules
5:04:35 PM: Finished restoring cached node modules
5:04:35 PM: Started restoring cached yarn cache
5:04:35 PM: Finished restoring cached yarn cache
5:04:35 PM: Installing yarn at version 1.17.0
5:04:35 PM: Installing Yarn!
5:04:35 PM: > Downloading tarball...
5:04:35 PM: [1/2]: https://yarnpkg.
5:04:35 PM: com/downloads/1.17.0/yarn-v1.17.0.tar.gz --> /tmp/yarn.tar.gz.McotYNlfYi
5:04:35 PM:   % Total    % Received % Xferd  Average Speed
5:04:35 PM:   Time    Time     Time  Current
5:04:35 PM:      Dload  Upload   T
5:04:35 PM: otal   Spent    Left  Spee
5:04:35 PM: d
5:04:35 PM: 
  0     0    0
5:04:35 PM:     0    0     0      0      0 --:--:-
5:04:35 PM: - --:--:-- --:-
5:04:35 PM: -:--     0
5:04:35 PM: 
  0     0    0     0    0
5:04:35 PM:   0      0      0 --:--:-- --:--:-- --:--:--     0
5:04:35 PM: 
100    80  100    80    0     0
5:04:35 PM:    248      0 --:--:-- --:--:-- --:--:--   248
5:04:36 PM: 
100    93  100    93    0     0    156      0 --:--:-- --:--:-- --:--:--
5:04:36 PM:   156
5:04:36 PM: 
100   630  100   630    0     0    727
5:04:36 PM:   0 --:--:-- --:--:-- --:--:--   727
5:04:36 PM: 
  0     0    0     0    0     0      0
5:04:36 PM:   0 --:--:--  0:00:01 --:--:--     0
5:04:36 PM: 1
5:04:36 PM: 0
5:04:36 PM: 0
5:04:36 PM:  1213k  100 1213k    0     0   947k      0
5:04:36 PM:   0:00:
5:04:36 PM: 01  0:00:01 --:--:-- 5617k
5:04:36 PM: [2/2]: https://yarnpkg.c
5:04:36 PM: om/downloads/1.17.0/yarn-v1.17.0.tar.gz.asc --> /tmp/yarn.tar.gz.McotYNl
5:04:36 PM: fYi.asc
5:04:36 PM: 
100    84  100
5:04:36 PM:     84    0     0   3038      0 --:--:-- --:--:-- --:--:--  3038
5:04:36 PM: 
100    97  100    97    0     0   1756      0 --:--:-- --:--:-- --:-
5:04:36 PM: -:--  1756
5:04:36 PM: 
100   634  100   634    0
5:04:36 PM:    0   7259      0 --:--:-- --:--:-- --:--:--  7259
5:04:36 PM: 
100   832  100   832    0     0   6532
5:04:36 PM:    0 --:--:-- --:--:-- --:--:--  6532
5:04:37 PM: > Verifying integrity...
5:04:37 PM: gpg:
5:04:37 PM: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
5:04:37 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
5:04:37 PM: gpg: WARNING: This key is not certified with a trusted signature!
5:04:37 PM: gpg:          There is no indication that the signature belongs to the owner.
5:04:37 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B
5:04:37 PM:  86E5 0310
5:04:37 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
5:04:37 PM: > GPG signature looks good
5:04:37 PM: > Extracting to ~/.yarn...
5:04:37 PM: > Adding to $PATH...
5:04:37 PM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.
5:04:38 PM: Installing NPM modules using Yarn version 1.17.0
5:04:38 PM: yarn install v1.17.0
5:04:38 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
5:04:38 PM: [1/4] Resolving packages...
5:04:39 PM: [2/4] Fetching packages...
5:04:53 PM: info fsevents@1.2.12: The platform "linux" is incompatible with this module.
5:04:53 PM: info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
5:04:53 PM: [3/4] Linking dependencies...
5:04:53 PM: warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
5:04:59 PM: [4/4] Building fresh packages...
5:05:08 PM: success Saved lockfile.
5:05:08 PM: Done in 29.48s.
5:05:08 PM: NPM modules installed using Yarn
5:05:08 PM: Started restoring cached go cache
5:05:08 PM: Finished restoring cached go cache
5:05:08 PM: unset GOOS;
5:05:08 PM: unset GOARCH;
5:05:08 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
5:05:08 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
5:05:08 PM: go version >&2;
5:05:08 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
5:05:08 PM: go version go1.12 linux/amd64
5:05:08 PM: Installing missing commands
5:05:08 PM: Verify run directory
5:05:08 PM: Executing user command: gridsome build
5:05:09 PM: Gridsome v0.7.14
5:05:09 PM: Initializing plugins...
5:05:09 PM: Loading data from https://joshcollinsworth.com
5:05:16 PM: Error: Status 401 - wp/v2/feedback
5:05:16 PM: Load sources - 6.52s
5:05:16 PM: Create GraphQL schema - 0.46s
5:05:16 PM: Create pages and templates - 0.07s
5:05:16 PM: Generate temporary code - 0.03s
5:05:16 PM: Bootstrap finish - 7.86s
5:05:17 PM: Compiling assets...
5:05:34 PM: Compile assets - 17.06s
5:05:34 PM: Execute GraphQL (44 queries) - 0.03s
5:05:34 PM: Write out page data (44 files) - 0.01s
5:05:34 PM: (node:2361) UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined
5:05:34 PM:     at a._callee$ (assets/js/page--src--pages--about-vue.3ddd7eab.js:932:17)
5:05:34 PM:     at tryCatch (assets/js/page--src--pages--about-vue.3ddd7eab.js:109:40)
5:05:34 PM:     at Generator.invoke [as _invoke] (assets/js/page--src--pages--about-vue.3ddd7eab.js:338:22)
5:05:34 PM:     at Generator.prototype.(anonymous function) [as next] (assets/js/page--src--pages--about-vue.3ddd7eab.js:161:21)
5:05:34 PM:     at asyncGeneratorStep (assets/js/page--src--pages--about-vue.3ddd7eab.js:839:24)
5:05:34 PM:     at _next (assets/js/page--src--pages--about-vue.3ddd7eab.js:861:9)
5:05:34 PM:     at assets/js/page--src--pages--about-vue.3ddd7eab.js:868:7
5:05:34 PM:     at new Promise (<anonymous>)
5:05:34 PM:     at a.<anonymous> (assets/js/page--src--pages--about-vue.3ddd7eab.js:857:12)
5:05:34 PM:     at a.getPosts (assets/js/page--src--pages--about-vue.3ddd7eab.js:959:26)
5:05:34 PM: (node:2361) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
5:05:34 PM: (node:2361) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
5:05:34 PM: Render HTML (44 files) - 0.78s
5:05:34 PM: Process files (0 files) - 0s
5:05:35 PM: 
5:05:35 PM: Processing images (41 images) - 0%
5:05:45 PM: 
5:05:45 PM: Processing images (41 images) - 50%
5:05:45 PM: 
5:05:45 PM: Processing images (41 images) - 100%Process images (41 images) - 10.88s
5:05:45 PM:   Done in 36.88s
5:05:46 PM: Skipping functions preparation step: no functions directory set
5:05:46 PM: Caching artifacts
5:05:46 PM: Started saving node modules
5:05:46 PM: Finished saving node modules
5:05:46 PM: Started saving yarn cache
5:05:46 PM: Finished saving yarn cache
5:05:46 PM: Started saving pip cache
5:05:46 PM: Finished saving pip cache
5:05:46 PM: Started saving emacs cask dependencies
5:05:46 PM: Finished saving emacs cask dependencies
5:05:46 PM: Started saving maven dependencies
5:05:46 PM: Finished saving maven dependencies
5:05:46 PM: Started saving boot dependencies
5:05:46 PM: Finished saving boot dependencies
5:05:46 PM: Started saving go dependencies
5:05:46 PM: Finished saving go dependencies
5:05:51 PM: Build script success
5:05:51 PM: Starting to deploy site from 'dist'
5:05:51 PM: Creating deploy tree 
5:05:51 PM: Creating deploy upload records
5:05:51 PM: 86 new files to upload
5:05:51 PM: 0 new functions to upload
5:05:54 PM: Starting post processing
5:06:02 PM: Post processing done
5:06:03 PM: Site is live
5:06:46 PM: Finished processing build request in 2m20.432723911s

Update: seems I’ve resolved the issue. I made two changes that may have fixed the problem; not sure which it was:

1.) Changed src/projects/*.md to ./src/projects/*.md in gridsome.config.js (though I’m pretty sure I tested after that change and it didn’t make a difference;

2.) Renamed project.vue, since there was another Project.vue file in the codebase (albeit in a different directory). Seems like potentially this build process somehow confused the two maybe.

1 Like