Hi,
I run into the following error when building my Hugo site on Netlify.
4:38:05 PM: Building sites … Total in 189 ms
4:38:05 PM: Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): resource "css/css/styles.css_ae2b995d116b5c2ff55ada87fcf5cdfe" not found in file cache
Full error message:
4:37:09 PM: Build ready to start
4:37:11 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
4:37:11 PM: build-image tag: v3.3.7
4:37:11 PM: buildbot version: 134ec431c6a3ff76e87cc4dc34007fe13842272f
4:37:11 PM: Fetching cached dependencies
4:37:11 PM: Starting to download cache of 253.3MB
4:37:12 PM: Finished downloading cache in 1.317095822s
4:37:12 PM: Starting to extract cache
4:37:20 PM: Finished extracting cache in 7.492992716s
4:37:20 PM: Finished fetching cache in 8.90172839s
4:37:20 PM: Starting to prepare the repo for build
4:37:20 PM: Preparing Git Reference refs/heads/master
4:37:23 PM: Starting build script
4:37:23 PM: Installing dependencies
4:37:23 PM: Started restoring cached node version
4:37:28 PM: Finished restoring cached node version
4:37:29 PM: v13.13.0 is already installed.
4:37:30 PM: Now using node v13.13.0 (npm v6.14.4)
4:37:30 PM: Attempting ruby version 2.6.2, read from environment
4:37:31 PM: Using ruby version 2.6.2
4:37:32 PM: Using PHP version 5.6
4:37:32 PM: Installing Hugo 0.69.0
4:37:32 PM: Hugo Static Site Generator v0.69.0-4205844B/extended linux/amd64 BuildDate: 2020-04-10T09:16:58Z
4:37:32 PM: Started restoring cached go cache
4:37:32 PM: Finished restoring cached go cache
4:37:32 PM: unset GOOS;
4:37:32 PM: unset GOARCH;
4:37:32 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
4:37:32 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
4:37:32 PM: go version >&2;
4:37:32 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
4:37:32 PM: go version go1.12 linux/amd64
4:37:32 PM: Installing missing commands
4:37:32 PM: Verify run directory
4:37:35 PM: Resolved Netlify Build version tag "latest" to "0.3.4"
4:37:35 PM: Netlify Build not installed. Installing Netlify Build version 0.3.4
4:37:59 PM: /opt/buildhome/.nvm/versions/node/v12.16.1/bin/netlify-build -> /opt/buildhome/.nvm/versions/node/v12.16.1/lib/node_modules/@netlify/build/src/core/bin.js
4:37:59 PM: + @netlify/build@0.3.4
4:37:59 PM: added 584 packages from 324 contributors in 23.482s
4:38:00 PM: Starting Netlify Build...
4:38:02 PM:
4:38:02 PM: ┌─────────────────────────────┐
4:38:02 PM: │ Netlify Build │
4:38:02 PM: └─────────────────────────────┘
4:38:02 PM:
4:38:02 PM: ❯ Version
4:38:02 PM: @netlify/build 0.3.4
4:38:02 PM:
4:38:02 PM: ❯ Flags
4:38:02 PM: mode: buildbot
4:38:02 PM:
4:38:02 PM: ❯ Current directory
4:38:02 PM: /opt/build/repo
4:38:02 PM:
4:38:02 PM: ❯ Config file
4:38:02 PM: /opt/build/repo/netlify.toml
4:38:02 PM:
4:38:02 PM: ❯ Context
4:38:02 PM: production
4:38:02 PM:
4:38:02 PM: ❯ Installing plugins
4:38:02 PM: - netlify-plugin-debug-cache
4:38:04 PM:
4:38:04 PM: ❯ Loading plugins
4:38:04 PM: - netlify-plugin-debug-cache@1.0.1
4:38:04 PM:
4:38:04 PM: ┌──────────────────────────────────────────────────────────────────┐
4:38:04 PM: │ 1. build.lifecycle.onBuild command from netlify.toml config file │
4:38:04 PM: └──────────────────────────────────────────────────────────────────┘
4:38:04 PM:
4:38:04 PM: $ hugo --gc --minify
4:38:05 PM: Building sites … Total in 189 ms
4:38:05 PM: Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): resource "css/css/styles.css_ae2b995d116b5c2ff55ada87fcf5cdfe" not found in file cache
4:38:05 PM:
4:38:05 PM: ┌──────────────────────────────────────────────────┐
4:38:05 PM: │ 2. onEnd command from netlify-plugin-debug-cache │
4:38:05 PM: └──────────────────────────────────────────────────┘
4:38:05 PM:
4:38:06 PM: Saving cache file manifest for debugging...
4:38:06 PM: Cache file count: 33831
4:38:06 PM: Cache manifest saved to public/cache-output.json
4:38:06 PM: Please download the build files to inspect cache-output.json.
4:38:06 PM: Instructions => http://bit.ly/netlify-dl-cache
4:38:06 PM:
4:38:06 PM: (netlify-plugin-debug-cache onEnd completed in 1.1s)
4:38:06 PM:
4:38:06 PM: ┌─────────────────────────────┐
4:38:06 PM: │ Build failed │
4:38:06 PM: └─────────────────────────────┘
4:38:06 PM:
4:38:06 PM: Error message
4:38:06 PM: Command failed with exit code 255: hugo --gc --minify
4:38:06 PM:
4:38:06 PM: Error location
4:38:06 PM: In configuration "build.lifecycle.onBuild" command:
4:38:06 PM: hugo --gc --minify
4:38:06 PM:
4:38:07 PM: Caching artifacts
4:38:07 PM: Started saving node modules
4:38:07 PM: Finished saving node modules
4:38:07 PM: Started saving pip cache
4:38:07 PM: Finished saving pip cache
4:38:07 PM: Started saving emacs cask dependencies
4:38:07 PM: Finished saving emacs cask dependencies
4:38:07 PM: Started saving maven dependencies
4:38:07 PM: Finished saving maven dependencies
4:38:07 PM: Started saving boot dependencies
4:38:07 PM: Finished saving boot dependencies
4:38:07 PM: Started saving go dependencies
4:38:07 PM: Finished saving go dependencies
4:38:07 PM: Error running command: Build script returned non-zero exit code: 1
4:38:07 PM: Failing build: Failed to build site
4:38:07 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
4:38:07 PM: Finished processing build request in 56.538763873s
I use:
- Hugo 0.69.0
- NodeJS 13
netlify.toml
[context.production.environment]
HUGO_VERSION = "0.69.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
NODE_VERSION = "13"
[build]
publish = "public"
command = "hugo --gc --minify"
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
On my local system when I either run
-
hugo server --disableFastRender --buildDrafts
or -
hugo --gc --minify
or hugo --gc --minify -e production
everything runs fine and let me see my page afterwards at localhost:1313
.
There is the same question from a different user here. Unfortunately his solution, removing NODE_ENV=production
, does not solve my problem.
The theme I’am using can be found here: GitHub - codedge/LoveIt
I ran the built multiple times, also with clearing the cache in between. Nothing helps.
Does anyone has a glimpse what could be the issue on Netlify here?
Thanks in advance!