CSS does not show up on deployed Netlify site

I have deployed my Ink theme site here, however the css does not show up.
The build:

1:10:16 AM: Build ready to start
1:10:18 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
1:10:18 AM: build-image tag: v4.3.0
1:10:18 AM: buildbot version: fd60e21d56897195475b3dbb3e1c495894eb873c
1:10:18 AM: Fetching cached dependencies
1:10:18 AM: Starting to download cache of 122.6MB
1:10:19 AM: Finished downloading cache in 730.648231ms
1:10:19 AM: Starting to extract cache
1:10:23 AM: Finished extracting cache in 4.072341951s
1:10:23 AM: Finished fetching cache in 4.834936038s
1:10:23 AM: Starting to prepare the repo for build
1:10:23 AM: Preparing Git Reference refs/heads/master
1:10:24 AM: Parsing package.json dependencies
1:10:24 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --gc --minify' versus 'hugo' in the Netlify UI
1:10:24 AM: Starting build script
1:10:25 AM: Installing dependencies
1:10:25 AM: Python version set to 2.7
1:10:25 AM: Started restoring cached node version
1:10:27 AM: Finished restoring cached node version
1:10:28 AM: v16.8.0 is already installed.
1:10:29 AM: Now using node v16.8.0 (npm v7.21.0)
1:10:29 AM: Started restoring cached build plugins
1:10:29 AM: Finished restoring cached build plugins
1:10:29 AM: Attempting ruby version 2.7.2, read from environment
1:10:31 AM: Using ruby version 2.7.2
1:10:31 AM: Using PHP version 8.0
1:10:31 AM: Installing Hugo 0.87.0
1:10:31 AM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
1:10:31 AM: Started restoring cached go cache
1:10:31 AM: Finished restoring cached go cache
1:10:31 AM: go version go1.16.5 linux/amd64
1:10:31 AM: go version go1.16.5 linux/amd64
1:10:31 AM: Installing missing commands
1:10:31 AM: Verify run directory
1:10:33 AM: ​
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM:   Netlify Build                                                 
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM: ​
1:10:33 AM: ❯ Version
1:10:33 AM:   @netlify/build 18.7.2
1:10:33 AM: ​
1:10:33 AM: ❯ Flags
1:10:33 AM:   baseRelDir: true
1:10:33 AM:   buildId: 612db9b73162c90008c4a855
1:10:33 AM:   deployId: 612db9b73162c90008c4a857
1:10:33 AM: ​
1:10:33 AM: ❯ Current directory
1:10:33 AM:   /opt/build/repo
1:10:33 AM: ​
1:10:33 AM: ❯ Config file
1:10:33 AM:   /opt/build/repo/netlify.toml
1:10:33 AM: ​
1:10:33 AM: ❯ Context
1:10:33 AM:   production
1:10:33 AM: ​
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM:   1. build.command from netlify.toml                            
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM: ​
1:10:33 AM: $ hugo --gc --minify
1:10:33 AM: Start building sites …
1:10:33 AM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM: WARN 2021/08/31 05:10:33 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
1:10:33 AM:                    | EN
1:10:33 AM: -------------------+-----
1:10:33 AM:   Pages            | 11
1:10:33 AM:   Paginator pages  |  0
1:10:33 AM: Creating deploy upload records
1:10:33 AM:   Non-page files   |  0
1:10:33 AM:   Static files     |  7
1:10:33 AM:   Processed images |  0
1:10:33 AM:   Aliases          |  0
1:10:33 AM:   Sitemaps         |  1
1:10:33 AM:   Cleaned          |  0
1:10:33 AM: Total in 36 ms
1:10:33 AM: ​
1:10:33 AM: (build.command completed in 113ms)
1:10:33 AM: ​
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM:   2. Deploy site                                                
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM: ​
1:10:33 AM: Starting to deploy site from 'public'
1:10:33 AM: Creating deploy tree 
1:10:33 AM: 0 new files to upload
1:10:33 AM: 0 new functions to upload
1:10:33 AM: Site deploy was successfully initiated
1:10:33 AM: ​
1:10:33 AM: (Deploy site completed in 148ms)
1:10:33 AM: ​
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM:   Netlify Build Complete                                        
1:10:33 AM: ────────────────────────────────────────────────────────────────
1:10:33 AM: ​
1:10:33 AM: (Netlify Build completed in 387ms)
1:10:33 AM: Starting post processing
1:10:33 AM: Post processing - HTML
1:10:33 AM: Post processing - header rules
1:10:33 AM: Post processing - redirect rules
1:10:33 AM: Post processing done
1:10:33 AM: Caching artifacts
1:10:33 AM: Started saving build plugins
1:10:33 AM: Finished saving build plugins
1:10:33 AM: Started saving pip cache
1:10:33 AM: Finished saving pip cache
1:10:33 AM: Started saving emacs cask dependencies
1:10:33 AM: Site is live ✨
1:10:33 AM: Finished saving emacs cask dependencies
1:10:33 AM: Started saving maven dependencies
1:10:33 AM: Finished saving maven dependencies
1:10:33 AM: Started saving boot dependencies
1:10:34 AM: Finished saving boot dependencies
1:10:34 AM: Started saving rust rustup cache
1:10:34 AM: Finished saving rust rustup cache
1:10:34 AM: Started saving go dependencies
1:10:34 AM: Finished saving go dependencies
1:10:34 AM: Build script success
1:10:56 AM: Finished processing build request in 38.313053421s

1. Visit the live site.
2. Open the browser dev tools.
3. Examine the 404 errors.

For example, it can’t find:

https://adrianaceric.netlify.app/example.comcss/normalize.css

Thank you for catching this!

I’m encountering another problem. I set my baseURL in my config.toml file to be https://adrianaceric.netlify.app/ and replaced all instances of example.com with that.
So now, my link to a css file looks like this:

<link rel=stylesheet type=text/css media=screen href=https://adrianaceric.netlify.appcss/normalize.css>

However, when I go to run it in my dev environment, nothing shows up, and I only get a warning that has to do with an extension:

DevTools failed to load source map: Could not load content for chrome-extension://bicebchdpeichdlmoaflplakefkjkade/src/content.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Thanks again for your help!

The warnings about chrome extensions are related to… chrome extensions. This is not a Hugo problem. Open an incognito window (no loaded extensions) and test again.

Regarding your other problem(s), please provide 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.

The site on Incognito still does not show up on the localhost.

The repository can be found here: GitHub - AdrianaCeric/mysite

You misunderstand. Testing in incognito mode was simply to show that the chrome-extension warnings are related to chrome extensions and nothing else.

Here’s what I did:

git clone --recurse-submodules https://github.com/AdrianaCeric/mysite
cd mysite
hugo server --theme ink

No errors, no warnings, everything looks fine.

It appears that something is off with your setup.

The lines in the source code of your site that call the stylesheets are identical to the following lines in public/index.html.

Usually it is recommended to not include the /public/ folder in the git repo of a Hugo project, so that the repository’s size does not increase exponentially.

It seems that Netlify is using the /public/ directory as per what is entered in the project’s netlify.toml.

I suggest that you delete the /public/ folder from your project’s repository and redeploy your site from the Netlify control panel by choosing the option to erase the cache.

Also include a .gitignore file with public in its contents so that it does not get picked up by git again.

Let us know how it goes.

I removed the public folder, and added /public/ to .gitignore
Now I get this error from Netlify after clearing cache and redeploying:

Deploy details from Netlify:

3:41:01 PM: Build ready to start
3:41:03 PM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
3:41:03 PM: build-image tag: v4.3.0
3:41:03 PM: buildbot version: fd60e21d56897195475b3dbb3e1c495894eb873c
3:41:03 PM: Building without cache
3:41:03 PM: Starting to prepare the repo for build
3:41:04 PM: No cached dependencies found. Cloning fresh repo
3:41:04 PM: git clone https://github.com/AdrianaCeric/mysite
3:41:04 PM: Preparing Git Reference refs/heads/master
3:41:05 PM: Parsing package.json dependencies
3:41:05 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --gc --minify' versus 'hugo' in the Netlify UI
3:41:05 PM: Starting build script
3:41:05 PM: Installing dependencies
3:41:05 PM: Python version set to 2.7
3:41:06 PM: Downloading and installing node v16.8.0...
3:41:07 PM: Downloading https://nodejs.org/dist/v16.8.0/node-v16.8.0-linux-x64.tar.xz...
3:41:07 PM: Computing checksum with sha256sum
3:41:07 PM: Checksums matched!
3:41:10 PM: Now using node v16.8.0 (npm v7.21.0)
3:41:10 PM: Started restoring cached build plugins
3:41:10 PM: Finished restoring cached build plugins
3:41:10 PM: Attempting ruby version 2.7.2, read from environment
3:41:11 PM: Using ruby version 2.7.2
3:41:12 PM: Using PHP version 8.0
3:41:12 PM: Installing Hugo 0.87.0
3:41:13 PM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
3:41:13 PM: Started restoring cached go cache
3:41:13 PM: Finished restoring cached go cache
3:41:13 PM: go version go1.16.5 linux/amd64
3:41:13 PM: go version go1.16.5 linux/amd64
3:41:13 PM: Installing missing commands
3:41:13 PM: Verify run directory
3:41:14 PM: ​
3:41:14 PM: ────────────────────────────────────────────────────────────────
3:41:14 PM:   Netlify Build                                                 
3:41:14 PM: ────────────────────────────────────────────────────────────────
3:41:14 PM: ​
3:41:14 PM: ❯ Version
3:41:14 PM:   @netlify/build 18.7.2
3:41:14 PM: ​
3:41:14 PM: ❯ Flags
3:41:14 PM:   baseRelDir: true
3:41:14 PM:   buildId: 612e85cd59b59620e01dd8f6
3:41:14 PM:   deployId: 612e85cd59b59620e01dd8f8
3:41:14 PM: ​
3:41:14 PM: ❯ Current directory
3:41:14 PM:   /opt/build/repo
3:41:14 PM: ​
3:41:14 PM: ❯ Config file
3:41:14 PM:   /opt/build/repo/netlify.toml
3:41:14 PM: ​
3:41:14 PM: ❯ Context
3:41:14 PM:   production
3:41:14 PM: ​
3:41:14 PM: ────────────────────────────────────────────────────────────────
3:41:14 PM:   1. build.command from netlify.toml                            
3:41:14 PM: ────────────────────────────────────────────────────────────────
3:41:14 PM: ​
3:41:14 PM: $ hugo --gc --minify
3:41:14 PM: Start building sites …
3:41:14 PM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:15 PM: Creating deploy upload records
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:14 PM: WARN 2021/08/31 19:41:14 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
3:41:15 PM:                    | EN
3:41:15 PM: -------------------+-----
3:41:15 PM:   Pages            | 11
3:41:15 PM:   Paginator pages  |  0
3:41:15 PM:   Non-page files   |  0
3:41:15 PM:   Static files     |  7
3:41:15 PM:   Processed images |  0
3:41:15 PM:   Aliases          |  0
3:41:15 PM:   Sitemaps         |  1
3:41:15 PM:   Cleaned          |  0
3:41:15 PM: Total in 204 ms
3:41:15 PM: ​
3:41:15 PM: (build.command completed in 261ms)
3:41:15 PM: Starting post processing
3:41:15 PM: ​
3:41:15 PM: ────────────────────────────────────────────────────────────────
3:41:15 PM:   2. Deploy site                                                
3:41:15 PM: ────────────────────────────────────────────────────────────────
3:41:15 PM: ​
3:41:15 PM: Starting to deploy site from 'public'
3:41:15 PM: Post processing - HTML
3:41:15 PM: Creating deploy tree 
3:41:15 PM: Post processing - header rules
3:41:15 PM: Post processing - redirect rules
3:41:15 PM: 0 new files to upload
3:41:15 PM: Post processing done
3:41:15 PM: 0 new functions to upload
3:41:15 PM: Site deploy was successfully initiated
3:41:15 PM: ​
3:41:15 PM: (Deploy site completed in 131ms)
3:41:15 PM: Site is live ✨
3:41:15 PM: ​
3:41:15 PM: ────────────────────────────────────────────────────────────────
3:41:15 PM:   Netlify Build Complete                                        
3:41:15 PM: ────────────────────────────────────────────────────────────────
3:41:15 PM: ​
3:41:15 PM: (Netlify Build completed in 443ms)
3:41:15 PM: Caching artifacts
3:41:15 PM: Started saving build plugins
3:41:15 PM: Finished saving build plugins
3:41:15 PM: Started saving pip cache
3:41:15 PM: Finished saving pip cache
3:41:15 PM: Started saving emacs cask dependencies
3:41:15 PM: Finished saving emacs cask dependencies
3:41:15 PM: Started saving maven dependencies
3:41:15 PM: Finished saving maven dependencies
3:41:15 PM: Started saving boot dependencies
3:41:15 PM: Finished saving boot dependencies
3:41:15 PM: Started saving rust rustup cache
3:41:15 PM: Finished saving rust rustup cache
3:41:15 PM: Started saving go dependencies
3:41:15 PM: Finished saving go dependencies
3:41:18 PM: Build script success
3:41:38 PM: Finished processing build request in 34.675922909s

How do I set up the Netlify configuration and netlify.toml without a public folder?

These are my build settings:

  • Repository: github.com/AdrianaCeric/mysite
  • Base directory: Not set
  • Build command: hugo
  • Publish directory: public
  • Deploy log visibility: Logs are public
  • Builds: Active

Deploying a Hugo project on Netlify does not require the public folder.

Your project does generate locally, therefore this is not technically a Hugo issue.

Have you tried looking at this guide on Netlify?

Also perhaps you would need to ask at the Netlify forums.

Hi @alexandros,

That format helped me fix the problem. I copied the layouts folder out of the themes so Netlify could identify the index.html. Thanks for all of your help!

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