CSS Map file not created on GitHub build, but is on local build

I noticed that my site build on GitHub is not creating the css.map file (the dev tools console says the file is missing and I confirmed it is not in GitHub repository).

When I build the site locally, the css.map file gets created in the public css folder with my minified css.

I am using two repositories on GitHub to build my site (one for the source code that pushes the static files to another repository – using a “peaceiris/actions-hugo@v2” based workflow).

I am new to Hugo (started earlier this year) and have tried to find other documentation to explain what is happening, but haven’t figured it out yet. I assume there is something obvious and small that I am missing.

My stylesheet code is:

{{ $options := (dict “outputStyle” “compressed” “enableSourceMap” true) }}
{{ $style := resources.Get “css/benwfey.scss” | resources.ToCSS $options }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />

This is not enough information to identify the problem.

You are more likely to receive a prompt and accurate response if you post a link to the public repository for your project.

See https://discourse.gohugo.io/t/requesting-help/9132.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

You can find my source repo here: GitHub - andsplat/andsplat-source: Source code for andsplat.com

You need to run the extended version of hugo when you build the site on GitHub:

diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 22449fa..9afc9fb 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -19,6 +19,7 @@ jobs:
         uses: peaceiris/actions-hugo@v2
           hugo-version: 'latest'
+          extended: true
       - name: Build
         run: hugo --minify
1 Like

Amazing! Fixed my issue. Still new to Hugo and wasn’t aware of the extended vs regular hugo build. Thank you for taking the time to help me.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.