Strange build behaviour, suddenly empty site

I was working on my site and it built fine

                   | LANGUAGES | EN  | DE   
-------------------+-----------+-----+------
  Pages            |        62 | 331 |  46  
  Paginator pages  |         0 |   8 |   0  
  Non-page files   |         1 |  22 |   1  
  Static files     |       117 | 117 | 117  
  Processed images |         0 | 118 |   0  
  Aliases          |        13 |  16 |   2  
  Sitemaps         |         2 |   1 |   1  
  Cleaned          |         0 |   0 |   0  

Suddenly the build result is different

                   | LANGUAGES | EN  | DE   
-------------------+-----------+-----+------
  Pages            |        12 |   1 |   1  
  Paginator pages  |         0 |   0 |   0  
  Non-page files   |         0 |   0 |   0  
  Static files     |       117 | 117 | 117  
  Processed images |         0 |   0 |   0  
  Aliases          |         2 |   0 |   0  
  Sitemaps         |         2 |   1 |   1  
  Cleaned          |         0 |   0 |   0  

Now there is an empty site
image
There are no obvious changes which explains that behaviour to me
image

Any hint?

There is more output when you run hugo. Add this and we might be able to gleam what’s going on.

By the way: “SUDDENLY” is never suddenly. You changed something. Some config parameter, some layout file, something changed and Hugo did what has been told it to do. If you can please somehow put a public repo of your site up so we can dive into it.

Yeah I agree and I carefully checked that no config parameters or so were changed. Interestingly, after closing all terminals and starting over, things are fine again. So there is obviously something wrong in my environment

❯ npm run start

> doks@0.1.5 prestart /home/papanito/Workspaces/docu-playground/my-doks-site
> npm run clean


> doks@0.1.5 clean /home/papanito/Workspaces/docu-playground/my-doks-site
> rimraf public resources functions


> doks@0.1.5 start /home/papanito/Workspaces/docu-playground/my-doks-site
> hugo server --disableFastRender

Start building sites … 
WARN 2021/02/16 14:46:06 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/de/docs/prologue/commands.md:1:1": duplicate menu entry with identifier "Commands" in menu "docs"
WARN 2021/02/16 14:46:06 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/de/docs/prologue/quick-start.md:1:1": duplicate menu entry with identifier "Quick Start" in menu "docs"
WARN 2021/02/16 14:46:06 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/en/docs/prologue/commands.md:1:1": duplicate menu entry with identifier "Commands" in menu "docs"
WARN 2021/02/16 14:46:06 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/en/docs/prologue/introduction.md:1:1": duplicate menu entry with identifier "Introduction" in menu "docs"
WARN 2021/02/16 14:46:06 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/en/docs/prologue/quick-start.md:1:1": duplicate menu entry with identifier "Quick Start" in menu "docs"
WARN 2021/02/16 14:46:09 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/de/docs/prologue/commands.md:1:1": duplicate menu entry with identifier "Commands" in menu "docs"
WARN 2021/02/16 14:46:09 "/home/papanito/Workspaces/docu-playground/my-doks-site/content/de/docs/prologue/quick-start.md:1:1": duplicate menu entry with identifier "Quick Start" in menu "docs"

                   | LANGUAGES | EN  | DE   
-------------------+-----------+-----+------
  Pages            |        62 | 331 |  46  
  Paginator pages  |         0 |   8 |   0  
  Non-page files   |         1 |  22 |   1  
  Static files     |       117 | 117 | 117  
  Processed images |         0 | 118 |   0  
  Aliases          |        13 |  16 |   2  
  Sitemaps         |         2 |   1 |   1  
  Cleaned          |         0 |   0 |   0  

Built in 3183 ms
Watching for changes in /home/papanito/Workspaces/docu-playground/my-doks-site/{archetypes,assets,babel.config.js,content,data,i18n,layouts,node_modules,package.json,static}
Watching for config changes in /home/papanito/Workspaces/docu-playground/my-doks-site/config/_default
Environment: "development"
Serving pages from memory
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
---
❯ npm run start

> doks@0.1.5 prestart /home/papanito/Workspaces/docu-playground/my-doks-site
> npm run clean


> doks@0.1.5 clean /home/papanito/Workspaces/docu-playground/my-doks-site
> rimraf public resources functions


> doks@0.1.5 start /home/papanito/Workspaces/docu-playground/my-doks-site
> hugo server --disableFastRender

Start building sites … 

                   | LANGUAGES | EN  | DE   
-------------------+-----------+-----+------
  Pages            |        12 |   1 |   1  
  Paginator pages  |         0 |   0 |   0  
  Non-page files   |         0 |   0 |   0  
  Static files     |       117 | 117 | 117  
  Processed images |         0 |   0 |   0  
  Aliases          |         2 |   0 |   0  
  Sitemaps         |         2 |   1 |   1  
  Cleaned          |         0 |   0 |   0  

Built in 249 ms
Watching for changes in /home/papanito/Workspaces/docu-playground/my-doks-site/{archetypes,assets,babel.config.js,content,data,i18n,layouts,node_modules,package.json,static}
Watching for config changes in /home/papanito/Workspaces/docu-playground/my-doks-site/config/_default
Environment: "development"
Serving pages from memory
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
^C

One thing is that this command line parameter changes only the files that you saved, not all of them… might be a part of the issue.

Then please post your package.json - script section. What exactly is “start” doing? Is it running twice or did you add two runs to the output?

I use the package.config provided from the theme I use as a basis

{
  "name": "doks",
  "version": "0.1.5",
  "private": true,
  "hugo-bin": {
    "buildTags": "extended"
  },
  "browserslist": [
    "defaults"
  ],
  "scripts": {
    "init": "rimraf .git && git init -b main",
    "create": "hugo new",
    "prestart": "npm run clean",
    "start": "hugo server --disableFastRender",
    "prebuild": "npm run clean",
    "build": "hugo --gc --minify && npm run build:functions",
    "build:functions": "netlify-lambda build assets/lambda",
    "build:preview": "npm run build -D -F",
    "clean": "rimraf public resources functions",
    "lint": "npm run -s lint:scripts && npm run -s lint:styles && npm run -s lint:markdown",
    "lint:scripts": "eslint assets/js assets/lambda config",
    "lint:styles": "stylelint \"assets/scss/**/*.{css,sass,scss,sss,less}\"",
    "lint:markdown": "markdownlint *.md content/**/*.md",
    "release": "standard-version",
    "server": "hugo server",
    "test": "npm run -s lint",
    "env": "env",
    "precheck": "npm version",
    "check": "hugo version"
  },
  "devDependencies": {
    "@babel/cli": "^7.12",
    "@babel/core": "^7.12",
    "@babel/preset-env": "^7.12",
    "@fullhuman/postcss-purgecss": "^4.0",
    "autoprefixer": "^10.2",
    "bootstrap": "^4.6",
    "clipboard": "^2.0",
    "eslint": "^7.18",
    "flexsearch": "^0.6",
    "hugo-bin": "^0.68.0",
    "instant.page": "^5.1",
    "lazysizes": "^5.3",
    "markdownlint-cli": "^0.26",
    "netlify-lambda": "^2.0",
    "postcss": "^8.2",
    "postcss-cli": "^8.3",
    "purgecss-whitelister": "^2.4",
    "rimraf": "^3.0",
    "standard-version": "^9.1",
    "stylelint": "^13.9",
    "stylelint-config-standard": "^20.0"
  },
  "dependencies": {
    "swizzle": "^1.1.0"
  }
}

What version of hugo are you using? I’m using 0.80 and am facing a similar extremely frustrating issue.

Also 0.80

did you check that?

It seemed like my issue was that I placed an index.md file in a folder when it should have been _index.md: Website links totally break upon minor changes - #11 by ChrisR .