Netlify-plugin-hashfiles is not working

Hello,

I’m trying to deploy a website with netlify-plugin-hashfiles plugin.

When I’m doing a local build with a simple hugo command there is a public/fonts/fontawesome5/fa-solid-900.eot file. But when I’m running netlify build the folder public/fonts/fontawesome5/ doesn’t contain several files (some are present, some are not). And I see that is a /static/fa-solid-900-<hash>.eot file - so hahsing was successful.

Without hashing plugin the issue is not reproduced. Any hints how to fix it?

One thing that I’m worry about is a variable in scss: $fa-font-path: "./fonts/fontawesome5"; (it is the latest change in git log). I’m not a web developer and I’m not sure about this path. There is a <repo root>/static/fonts/fontawesome5/* folder which contain necessary files.

I can provide an access to the repo for debugging purpose.

Full log
11:35:30 AM: build-image version: 0bc34a4ade77d89b410ec23c508464028dd4b785 (focal)
11:35:30 AM: buildbot version: 0bc34a4ade77d89b410ec23c508464028dd4b785
11:35:30 AM: Building without cache
11:35:30 AM: Starting to prepare the repo for build
11:35:30 AM: Git LFS enabled
11:35:30 AM: No cached dependencies found. Cloning fresh repo
11:35:30 AM: git clone --filter=blob:none https://github.com/sportdanceby/sportdance-by
11:35:31 AM: Preparing Git Reference refs/heads/main
11:35:37 AM: using git lfs to download blobs that match: *.ai,*.cdr,*.doc,*.docx,.eot,*.gif,*.ico,*.jpeg,*.jpg,*.pdf,*.png,*.rtf,*.svg,*.ttf,*.woff,*.woff2,*.xcf,*.xls,*.xlsx,*.zip
11:35:38 AM: Parsing package.json dependencies
11:35:39 AM: Starting build script
11:35:39 AM: Installing dependencies
11:35:39 AM: Python version set to 2.7
11:35:40 AM: v16.19.0 is already installed.
11:35:40 AM: Now using node v16.19.0 (npm v8.19.3)
11:35:40 AM: Enabling Node.js Corepack
11:35:40 AM: Started restoring cached build plugins
11:35:40 AM: Finished restoring cached build plugins
11:35:40 AM: Attempting Ruby version 2.7.2, read from environment
11:35:41 AM: Using Ruby version 2.7.2
11:35:41 AM: Using PHP version 8.0
11:35:41 AM: Installing Hugo 0.110.0
11:35:42 AM: hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168+extended linux/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio
11:35:42 AM: Started restoring cached go cache
11:35:42 AM: Finished restoring cached go cache
11:35:42 AM: Installing Go version 1.17 (requested 1.17)
11:35:46 AM: go version go1.17 linux/amd64
11:35:47 AM: Detected 2 framework(s)
11:35:47 AM: "hugo" at version "unknown"
11:35:47 AM: "zola" at version "unknown"
11:35:47 AM: Installing missing commands
11:35:47 AM: Verify run directory
11:35:47 AM: Section completed: initializing
11:35:48 AM: ​
11:35:48 AM:   Netlify Build                                                 
11:35:48 AM: ────────────────────────────────────────────────────────────────
11:35:48 AM: ​
11:35:48 AM: ❯ Version
11:35:48 AM:   @netlify/build 29.5.4
11:35:48 AM: ​
11:35:48 AM: ❯ Flags
11:35:48 AM:   baseRelDir: true
11:35:48 AM:   buildId: 63e2295ddca38b4d506addf9
11:35:48 AM:   deployId: 63e2295ddca38b4d506addfb
11:35:48 AM: ​
11:35:48 AM: ❯ Current directory
11:35:48 AM:   /opt/build/repo
11:35:48 AM: ​
11:35:48 AM: ❯ Config file
11:35:48 AM:   /opt/build/repo/netlify.toml
11:35:48 AM: ​
11:35:48 AM: ❯ Context
11:35:48 AM:   production
11:35:48 AM: ​
11:35:48 AM: ❯ Installing plugins
11:35:48 AM:    - @netlify/plugin-sitemap@0.8.1
11:35:48 AM:    - netlify-plugin-submit-sitemap@0.4.0
11:35:48 AM:    - netlify-plugin-hashfiles@4.0.2
11:35:48 AM:    - netlify-plugin-hugo-cache-resources@0.2.1
11:36:01 AM: ​
11:36:01 AM: ❯ Loading plugins
11:36:01 AM:    - @netlify/plugin-sitemap@0.8.1 from Netlify app
11:36:01 AM:    - netlify-plugin-submit-sitemap@0.4.0 from Netlify app
11:36:01 AM:    - netlify-plugin-hashfiles@4.0.2 from Netlify app
11:36:01 AM:    - netlify-plugin-hugo-cache-resources@0.2.1 from Netlify app
11:36:04 AM: ​
11:36:04 AM:   1. netlify-plugin-hugo-cache-resources (onPreBuild event)     
11:36:04 AM: ────────────────────────────────────────────────────────────────
11:36:04 AM: ​
11:36:04 AM: Checking if resources exist at "resources"
11:36:04 AM: No cache found for resources folder
11:36:04 AM: ​
11:36:04 AM: (netlify-plugin-hugo-cache-resources onPreBuild completed in 8ms)
11:36:04 AM: ​
11:36:04 AM:   2. build.command from netlify.toml                            
11:36:04 AM: ────────────────────────────────────────────────────────────────
11:36:04 AM: ​
11:36:04 AM: $ hugo
11:36:04 AM: Start building sites …
11:36:04 AM: hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168+extended linux/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio
11:36:04 AM:                    | RU
11:36:04 AM: -------------------+------
11:36:04 AM:   Pages            | 144
11:36:04 AM:   Paginator pages  |  22
11:36:04 AM:   Non-page files   |   1
11:36:04 AM:   Static files     | 259
11:36:04 AM:   Processed images |   0
11:36:04 AM:   Aliases          |  12
11:36:04 AM:   Sitemaps         |   1
11:36:04 AM:   Cleaned          |   0
11:36:04 AM: Total in 306 ms
11:36:04 AM: ​
11:36:04 AM: (build.command completed in 342ms)
11:36:04 AM: ​
11:36:04 AM:   3. @netlify/plugin-sitemap (onPostBuild event)                
11:36:04 AM: ────────────────────────────────────────────────────────────────
11:36:04 AM: ​
11:36:04 AM: Creating sitemap from files...
11:36:04 AM: Sitemap Built! sitemap.xml
11:36:04 AM: ​
11:36:04 AM: (@netlify/plugin-sitemap onPostBuild completed in 56ms)
11:36:04 AM: ​
11:36:04 AM:   4. netlify-plugin-hashfiles (onPostBuild event)               
11:36:04 AM: ────────────────────────────────────────────────────────────────
11:36:04 AM: ​
11:36:04 AM:  ✔ 0.001 secs: logEvents
11:36:05 AM:  ✔ 0.217 secs: loadAssets
11:36:23 AM:  ✔ 18.332 secs: populate
11:36:32 AM: ​
11:36:32 AM:   Plugin "netlify-plugin-hashfiles" internal error              
11:36:32 AM: ────────────────────────────────────────────────────────────────
11:36:32 AM: ​
11:36:32 AM:   Error message
11:36:32 AM:   UnhandledRejection: a promise was rejected but not handled: Error: ENOENT: no such file or directory, unlink '/opt/build/repo/public/fonts/fontawesome5/fa-solid-900.eot'
11:36:32 AM:   Error: ENOENT: no such file or directory, unlink '/opt/build/repo/public/fonts/fontawesome5/fa-solid-900.eot'
11:36:32 AM: ​
11:36:32 AM:   Plugin details
11:36:32 AM:   Package:        netlify-plugin-hashfiles
11:36:32 AM:   Version:        4.0.2
11:36:32 AM:   Repository:     git://github.com/munter/netlify-plugin-hashfiles.git
11:36:32 AM:   npm link:       https://www.npmjs.com/package/netlify-plugin-hashfiles
11:36:32 AM:   Report issues:  https://github.com/munter/netlify-plugin-hashfiles/issues
11:36:32 AM: ​
11:36:32 AM:   Error location
11:36:32 AM:   In "onPostBuild" event in "netlify-plugin-hashfiles" from Netlify app
11:36:32 AM: ​
11:36:32 AM:   Error properties
11:36:32 AM:   {
11:36:32 AM:     errno: -2,
11:36:32 AM:     code: 'ENOENT',
11:36:32 AM:     syscall: 'unlink',
11:36:32 AM:     path: '/opt/build/repo/public/fonts/fontawesome5/fa-solid-900.eot'
11:36:32 AM:   }
11:36:32 AM: ​
11:36:32 AM:   Resolved config
11:36:32 AM:   build:
11:36:32 AM:     command: hugo
11:36:32 AM:     commandOrigin: config
11:36:32 AM:     environment:
11:36:33 AM: Failed during stage 'building site': Build script returned non-zero exit code: 3 (https://ntl.fyi/exit-code-3)
11:36:32 AM:       - GIT_LFS_ENABLED
11:36:32 AM:       - GIT_LFS_FETCH_INCLUDE
11:36:32 AM:       - HUGO_VERSION
11:36:32 AM:     publish: /opt/build/repo/public
11:36:32 AM:     publishOrigin: config
11:36:32 AM:   plugins:
11:36:32 AM:     - inputs: {}
11:36:32 AM:       origin: ui
11:36:32 AM:       package: '@netlify/plugin-sitemap'
11:36:32 AM:     - inputs: {}
11:36:32 AM:       origin: ui
11:36:32 AM:       package: netlify-plugin-submit-sitemap
11:36:32 AM:     - inputs: {}
11:36:32 AM:       origin: ui
11:36:32 AM:       package: netlify-plugin-hashfiles
11:36:32 AM:     - inputs: {}
11:36:32 AM:       origin: ui
11:36:32 AM:       package: netlify-plugin-hugo-cache-resources
11:36:32 AM: Caching artifacts
11:36:32 AM: Started saving build plugins
11:36:32 AM: Finished saving build plugins
11:36:32 AM: Started saving pip cache
11:36:32 AM: Finished saving pip cache
11:36:32 AM: Started saving emacs cask dependencies
11:36:32 AM: Finished saving emacs cask dependencies
11:36:32 AM: Started saving maven dependencies
11:36:32 AM: Finished saving maven dependencies
11:36:32 AM: Started saving boot dependencies
11:36:32 AM: Finished saving boot dependencies
11:36:32 AM: Started saving rust rustup cache
11:36:32 AM: Finished saving rust rustup cache
11:36:32 AM: Started saving go dependencies
11:36:32 AM: Finished saving go dependencies
11:36:33 AM: Build failed due to a plugin error: Build script returned non-zero exit code: 3
11:36:33 AM: Failing build: Failed to build site
11:36:33 AM: Finished processing build request in 1m3.505s

What is your site name?

sportdance.by
Right now plugin is disabled

Or https://sportdance-by.netlify.app/

This is not a Netlify-maintained plugin. You can try reaching out to the plugin dev for help: GitHub - Munter/netlify-plugin-hashfiles: Netlify build plugin to get optimal file caching with hashed file names and immutable cache headers. The last update was 3 years ago, chances are something might be broken now.

1 Like