# No static files after Hugo Update from 0.41 to 0.42.1

**URL:** https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481
**Category:** Uncategorized
**Created:** [June 17, 2018, 11:43am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481 "2018-06-17T11:43:00Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 17, 2018, 11:43am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/1 "2018-06-17T11:43:01Z")

</div>

After Update Hugo from 0.41 to 0.42.1 the static files are missing.  
Hugo Static Site Generator v0.42.1 linux/amd64 BuildDate: 2018-06-13T10:16:36Z

I changed nothing on my Page. I would only update Hugo. The Page error is on my multilanguage page. On my single language Page the Update works fine.

Build with Hugo 0.42.1

> ```
> | EN | DE  
> 
> ```
> 
> ±-----------------±—±—+  
> Pages | 17 | 17  
> Paginator pages | 0 | 0  
> Non-page files | 0 | 0  
> Static files | 0 | 0  
> Processed images | 0 | 0  
> Aliases | 0 | 0  
> Sitemaps | 1 | 1  
> Cleaned | 0 | 0

Build with Version 0.41

> ```
> | EN | DE  
> 
> ```
> 
> ±-----------------±—±—+  
> Pages | 17 | 17  
> Paginator pages | 0 | 0  
> Non-page files | 0 | 0  
> Static files | 22 | 22  
> Processed images | 0 | 0  
> Aliases | 0 | 0  
> Sitemaps | 1 | 1  
> Cleaned | 0 | 0

---

<div class="post-metadata">

### Author: ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)
#### Post date: [June 17, 2018, 5:11pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/2 "2018-06-17T17:11:59Z")

</div>

Ah, it is probably a matter of version provision corruption on the static core. Pre-clearing caches across the base domain should fix your…

**NAH!** Just kidding. We can’t know what is happening without seeing your code! Please read [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132?u=maiki) and post a repo so someone can help ya. 🙂

---

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 18, 2018, 8:41am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/5 "2018-06-18T08:41:48Z")

</div>

Maybe the error is in my config.toml?

```
title = "Example"
languageCode = "en-us"

contentDir = "content"
layoutDir = "layouts"
publishDir = "public"

enableRobotsTXT = "true"

theme = "home"
canonifyurls = true
disableKinds = ["taxonomy", "taxonomyTerm"]

[sitemap]
    ChangeFreq = "weekly"
    Priority = ".5"

[params]
    # General information
    author = ""
    description = "Website"
    publisher = "example.com"
    copyright = "example.com"

    # Repository
    provider = "GitLab"
    repo_url = "https://gitlab.com//example/homepage"

    version = "0.1.0"
    logo = "images/Logo-Standard.jpg"

    # Fonts
    googlefonts = [
        "Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic",
        "Roboto+Mono:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic"
        ]

# Language configuration
defaultContentLanguage = "de"
defaultContentLanguageInSubdir = true

[languages]
    [languages.en]
        baseURL = "https://example.com/"
        languageName = "Englisch"
        languageCode = "en-us"
        contentDir = "content/en"

    [languages.de]
        baseURL = "https://example.de/"
        languageName = "German"
        languageCode = "de-de"
        contentDir = "content/de"
```

---

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 18, 2018, 10:06am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/6 "2018-06-18T10:06:09Z")

</div>

After a conversation with @bep the config.toml is no valid. I changed some lines but the error is still alive.  
Please help me to find the error. I am not the only one with a multilingual page here.

> Your config.toml isn’t valid TOML, which may or may not be the cause of this. Only maps can follow another map.

> You need to move the “defaultContentLanguage\*” settings near the top (above the maps/dicitonaries)

> [languages]  
> The above starts a map definition.  
> theme = “home”  
> The above is a single property. That and similar need to be above all maps definition.  
> Take further questions/trouble shooting on [https://discourse.gohugo.io/](https://discourse.gohugo.io/)

> We can bring it back here if it is a real bug.

```
title = "Company"
languageCode = "en-us"

theme = "homepage"

# Language configuration
defaultContentLanguage = "de"
defaultContentLanguageInSubdir = true

[languages]
    [languages.en]
        baseURL = "https://example.com/"
        languageName = "Englisch"
        languageCode = "en-us"
        contentDir = "content/en"

    [languages.de]
        baseURL = "https://example.de/"
        languageName = "German"
        languageCode = "de-de"
        contentDir = "content/de"

canonifyurls = true
disableKinds = ["taxonomy", "taxonomyTerm"]

enableRobotsTXT = true

[sitemap]
    ChangeFreq = "weekly"
    Priority = ".5"

[params]
    # General information
    author = "Example"
    description = "Example"
    publisher = "example.com"
    copyright = "Example"

    # Repository
    provider = "GitLab"
    repo_url = "https://gitlab.com//example/homepage"

    version = "0.1.0"
    logo = "images/Logo-Standard.jpg"

    # Fonts
    googlefonts = [
        "Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic",
        "Roboto+Mono:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic"
        ]

```

---

<div class="post-metadata">

### Author: ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)
#### Post date: [June 18, 2018, 11:42am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/7 "2018-06-18T11:42:15Z")

</div>

Ok, so easy things first:

> [@](#):
>
> Only maps can follow another map.

That means anything that doesn’t belong under `[these]` should go before the first of `[these]` are defined:

```auto
title = "Example GmbH"
languageCode = "en-us"

contentDir = "content"
layoutDir = "layouts"
publishDir = "public"
staticDir = "static"
enableRobotsTXT = "true"

theme = "example"
canonifyURLs = true
disableKinds = ["taxonomy", "taxonomyTerm"]

# Language configuration
defaultContentLanguage = "de"
defaultContentLanguageInSubdir = true

[sitemap]
    ...
[params]
    ...
[languages]
    [languages.en]
        ...
    [languages.de]
        ...

```

Now the difficult bit:

I don’t have a multilingual setup myself, but FWIW the `static` files seem to disappear when `baseURL`s are set in languages.

```auto
[languages]
    [languages.en]
        baseURL = "https://example.com/" 
        ...
    [languages.de]
        baseURL = "https://example.de/"
        ...

```

I’m not sure how to fix it, but I hope this helps someone else help you.

---

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 18, 2018, 12:14pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/8 "2018-06-18T12:14:24Z")

</div>

In the docs you can find this example for the baseURL

```
[languages]
  [languages.en]
    baseURL = "https://example.com"
    languageName = "English"
    title = "In English"
    weight = 2
  [languages.no]
    baseURL = "https://example.no"
    languageName = "Norsk"
    title = "På norsk"
    weight = 1
```

---

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 19, 2018, 5:51am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/9 "2018-06-19T05:51:37Z")

</div>

Here all the log files together.

After Update Hugo from 0.41 to 0.42.1 the static files are missing.  
Hugo Static Site Generator v0.42.1 linux/amd64 BuildDate: 2018-06-13T10:16:36Z

I changed nothing on my Page. I would only update Hugo. The Page error is on my multi language page. On my single language Page the Update works fine. The Repo is not public. Please send me am PM, then I  
give you access. I am a gitlab user

Build with Hugo 0.42.1

```
[user@tobbie homepage]$ hugo server -vvv
WARN 2018/06/19 07:27:24 No translation bundle found for default language "de"
WARN 2018/06/19 07:27:24 Translation func for language en not found, use default.
WARN 2018/06/19 07:27:24 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
WARN 2018/06/19 07:27:24 Translation func for language de not found, use default.
WARN 2018/06/19 07:27:24 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/06/19 07:27:24 Using config file: /home/user/Projects/homepage/config.toml
Building sites … INFO 2018/06/19 07:27:24 syncing static files to /en
WARN 2018/06/19 07:27:24 No Static directory found
INFO 2018/06/19 07:27:24 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO 2018/06/19 07:27:24 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}

                   | EN | DE  
+------------------+----+----+
  Pages | 21 | 17  
  Paginator pages | 0 | 0  
  Non-page files | 0 | 0  
  Static files | 0 | 0  
  Processed images | 0 | 0  
  Aliases | 0 | 0  
  Sitemaps | 1 | 1  
  Cleaned | 0 | 0  

Total in 47 ms
Watching for changes in /home/user/Projects/homepage/{content,layouts,themes}
Watching for config changes in /home/user/Projects/homepage/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Web Server is available at http://localhost:1314/ (bind address 127.0.0.1)
Press Ctrl+C to stop

```

Here the config.toml

```
title = "Company"
languageCode = "en-us"

theme = "example"

contentDir = "content"
layoutDir = "layouts"
publishDir = "public"
staticDir = "static"

canonifyurls = true

enableRobotsTXT = "true"

defaultContentLanguage = "de"
defaultContentLanguageInSubdir = true

[languages]
  [languages.en]
  baseURL = "https://example.com/"
  languageName = "Englisch"
  languageCode = "en-us"
  contentDir = "content/en"

  [languages.de]
  baseURL = "https://example.de/"
  languageName = "German"
  languageCode = "de-de"
  contentDir = "content/de"

disableKinds = [
  "taxonomy",
  "taxonomyTerm"
]

[sitemap]
    ChangeFreq = "weekly"
    Priority = ".5"

[params]
    author = "Example"
    description = "Website"
    publisher = "example.com"
    copyright = "Example"

    provider = "GitLab"
    repo_url = "https://gitlab.com//example/homepage"

    version = "0.1.0"
    logo = "images/Logo-Standard.jpg"

googlefonts = [
  "Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic",
  "Roboto+Mono:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic"
]

```

Build with Hugo 0.41

```
[user@tobbie homepage]$ hugo server -vvv
INFO 2018/06/19 07:37:32 Using config file: /home/user/Projects/homepage/config.toml
Building sites … WARN 2018/06/19 07:37:32 Unable to find Static Directory: /home/user/Projects/homepage/static/
INFO 2018/06/19 07:37:32 syncing static files to /en
WARN 2018/06/19 07:37:32 No translation bundle found for default language "de"
WARN 2018/06/19 07:37:32 Translation func for language en not found, use default.
WARN 2018/06/19 07:37:32 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
WARN 2018/06/19 07:37:32 Unable to find Static Directory: /home/user/Projects/homepage/static/
INFO 2018/06/19 07:37:32 syncing static files to /de
WARN 2018/06/19 07:37:32 Translation func for language de not found, use default.
WARN 2018/06/19 07:37:32 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/06/19 07:37:32 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO 2018/06/19 07:37:32 found taxonomies: map[string]string{"category":"categories", "tag":"tags"}

                   | EN | DE  
+------------------+----+----+
  Pages | 21 | 17  
  Paginator pages | 0 | 0  
  Non-page files | 0 | 0  
  Static files | 22 | 22  
  Processed images | 0 | 0  
  Aliases | 0 | 0  
  Sitemaps | 1 | 1  
  Cleaned | 0 | 0  

Total in 71 ms
WARN 2018/06/19 07:37:32 Skip dataDir: lstat /home/user/Projects/homepage/data: no such file or directory
WARN 2018/06/19 07:37:32 Skip i18nDir: lstat /home/user/Projects/homepage/i18n: no such file or directory
WARN 2018/06/19 07:37:32 Skip staticDir: lstat /home/user/Projects/homepage/static/: no such file or directory
Watching for changes in /home/user/Projects/homepage/{content,layouts,themes}
Watching for config changes in /home/user/Projects/homepage/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Web Server is available at http://localhost:1314/ (bind address 127.0.0.1)
Press Ctrl+C to stop
```

---

<div class="post-metadata">

### Author: ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)
#### Post date: [June 19, 2018, 7:57pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/10 "2018-06-19T19:57:40Z")

</div>

@Joerg, have you tried 0.42.1 without multilingual support? I would try that. If it suddenly works, then it is a language config thing, but if not maybe it is something else.

---

<div class="post-metadata">

### Author: ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)
#### Post date: [June 20, 2018, 6:00am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/11 "2018-06-20T06:00:04Z")

</div>

Yes I have some other Hugo projects with only one language, The Update works fine. Why works the multi language page with Version 0.41 and not with 0.42.x? I have changed nothing. The question is what changes were made in the Hugo code? I hope in the next updates the problem will be fixed.

---

<div class="post-metadata">

### Author: ![baekholt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/baekholt/32/6266_2.png) [@baekholt](https://discourse.gohugo.io/u/baekholt)
#### Post date: [June 28, 2018, 9:32am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/12 "2018-06-28T09:32:28Z")

</div>

I am experiencing the same problem.

I have a multilingual site configured with two languages in a Multilingual Multihost configuration.  
It worked fine when i was using version 40.2. After my upgrade to 42.1, the site ignores the ‘static’ directory in my theme. If i remove the multilingual configuration, it builds fine.

It seems to be a newly introduced bug, but there may of course be something smart i am missing.

---

<div class="post-metadata">

### Author: ![baekholt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/baekholt/32/6266_2.png) [@baekholt](https://discourse.gohugo.io/u/baekholt)
#### Post date: [June 28, 2018, 9:37am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/13 "2018-06-28T09:37:20Z")

</div>

I managed to work around the problem by hardcoding my theme’s static directory into to my config.toml.

`staticDir = ["static","themes/crypho/static"]`

This does not at all seem like a correct thing to do, but solves the problem temproarily for me, until we figure out how to fix it correctly.

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [June 28, 2018, 9:42am UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/14 "2018-06-28T09:42:21Z")

</div>

Since you can specify static directories per language now per:

> **[Static Files](https://gohugo.io/content-management/static-files/#readout)**
>
> Files that get served \*\*statically\*\* (as-is, no modification) on the site root.

… perhaps this is a matter of simply not specifying static in the general section, then?

I’ve got one `static` in this site and am simply not specifying it in config.toml. It’s working for me:

> <https://github.com/RickCogley/eSolia_2018/blob/master/config.toml>

---

<div class="post-metadata">

### Author: ![baekholt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/baekholt/32/6266_2.png) [@baekholt](https://discourse.gohugo.io/u/baekholt)
#### Post date: [June 28, 2018, 12:47pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/15 "2018-06-28T12:47:13Z")

</div>

This does not seem to solve it.

When i remove the ´staticDir´ directive, it returns to the erronous behaviour:

It includes the static directory for the site, but ignores the one from the theme.

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [June 28, 2018, 12:55pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/16 "2018-06-28T12:55:52Z")

</div>

Ok, the difference in my situation is, I’m not using a theme. Maybe your solution is _the_ way to solve it, @baekholt. Maybe we need to always include something like `staticDir = ["static","themes/crypho/static"]` if you’re using a theme…

---

<div class="post-metadata">

### Author: ![baekholt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/baekholt/32/6266_2.png) [@baekholt](https://discourse.gohugo.io/u/baekholt)
#### Post date: [June 28, 2018, 1:27pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/17 "2018-06-28T13:27:02Z")

</div>

Well that fixes my issue for now, bt it seems very inflexible for those that work with multiple themes.

What puzzles me is that this worked perfectly fine on version 40.2, but started breaking after I upgraded.

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [June 28, 2018, 1:56pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/18 "2018-06-28T13:56:25Z")

</div>

If you’re clear on what happened and when, maybe make a Github issue to flag it.

---

<div class="post-metadata">

### Author: ![baekholt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/baekholt/32/6266_2.png) [@baekholt](https://discourse.gohugo.io/u/baekholt)
#### Post date: [June 28, 2018, 2:03pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/19 "2018-06-28T14:03:03Z")

</div>

Yes. I am not familiar with the codebase, so I cannot tell where it was introduced. I just know between 40.2 and 42.0. I will try to file an issue. Thanks 🙂

---

<div class="post-metadata">

### Author: ![Zebradil](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zebradil/32/5788_2.png) [@Zebradil](https://discourse.gohugo.io/u/Zebradil)
#### Post date: [July 8, 2018, 9:27pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/20 "2018-07-08T21:27:49Z")

</div>

Hello there. I run into this problem too.  
Have you managed to file an issue? I’d like to subscribe to it.

---

<div class="post-metadata">

### Author: ![lord-re](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lord-re/32/14587_2.png) [@lord-re](https://discourse.gohugo.io/u/lord-re)
#### Post date: [July 13, 2018, 4:55pm UTC](https://discourse.gohugo.io/t/no-static-files-after-hugo-update-from-0-41-to-0-42-1/12481/21 "2018-07-13T16:55:55Z")

</div>

It’s now solved in 0.44.

> <https://github.com/gohugoio/hugo/issues/4929>
