google/docsy

Error building site: POSTCSS: failed to transform "scss/main.css"

Opened this issue Ā· 5 comments

Hello,

Currently testing hugo with the docsy theme, but running into a strange problem:

When I run the server:

$ hugo server   

                   | EN  
-------------------+-----
  Pages            | 10  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 36  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Built in 211 ms
Watching for changes in /home/mum/aws/hugo/src/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /home/mum/aws/hugo/src/config.toml, /home/mum/aws/hugo/src/themes/docsy/config.toml
Environment: "development"
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)
Press Ctrl+C to stop

but when want to build the file only.

hugo        
Total in 217 ms
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): resource "scss/scss/main.scss_4853eb546e7a6c0898ed71feae7357c0" not found in file cache

Hugo version:

hugo version                                                                                                                                 255 ā†µ
Hugo Static Site Generator v0.68.3-157669A0/extended linux/amd64 BuildDate: 2020-03-24T12:13:38Z

Any help on this please!

had this, fixed it by installing the npm packages using the -g flag, eg:

sudo npm install -g postcss-cli

after that things started behaving

npm install -g postcss-cli
npm install autoprefixer
npm audit fix

Yes, if you don't have postcss installed either globally or in the directory where you're running hugo, the asset builds won't work. Hope it's all working now!

Error occurring with v0.70.0-7F47B99E windows/amd64:

Building sites ā€¦ WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/05/10 22:10:30 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
ERROR 2020/05/10 22:10:30 TOCSS: failed to transform "critical.pcss" (/): resource "pcss/critical.pcss_832876c32a71faa43531d9a08ead6e38" not found in file cache
Built in 108 ms
Error: Error building site: failed to render pages: render of "home" failed: "C:\Users\dylan\dev\portfolio-site-3\layouts\_default\baseof.html:9:26": execute of template failed: template: index.html:9:26: executing "index.html" at <$criticalStyle.Content>: error calling Content: TOCSS: failed to transform "critical.pcss" (/): resource "pcss/critical.pcss_832876c32a71faa43531d9a08ead6e38" not found in file cache

Contents of node_modules/.bin:

-rwxr-xr-x 1 dylan 197609 318 May 10 22:02 atob*
-rw-r--r-- 1 dylan 197609 276 May 10 22:02 atob.cmd
-rwxr-xr-x 1 dylan 197609 488 May 10 22:02 atob.ps1*
-rwxr-xr-x 1 dylan 197609 344 May 10 22:09 autoprefixer*
-rw-r--r-- 1 dylan 197609 289 May 10 22:09 autoprefixer.cmd
-rwxr-xr-x 1 dylan 197609 514 May 10 22:09 autoprefixer.ps1*
-rwxr-xr-x 1 dylan 197609 324 May 10 22:02 browserslist*
-rw-r--r-- 1 dylan 197609 279 May 10 22:02 browserslist.cmd
-rwxr-xr-x 1 dylan 197609 494 May 10 22:02 browserslist.ps1*
-rwxr-xr-x 1 dylan 197609 332 May 10 22:02 css-blank-pseudo*
-rw-r--r-- 1 dylan 197609 283 May 10 22:02 css-blank-pseudo.cmd
-rwxr-xr-x 1 dylan 197609 502 May 10 22:02 css-blank-pseudo.ps1*
-rwxr-xr-x 1 dylan 197609 320 May 10 22:02 cssesc*
-rw-r--r-- 1 dylan 197609 277 May 10 22:02 cssesc.cmd
-rwxr-xr-x 1 dylan 197609 490 May 10 22:02 cssesc.ps1*
-rwxr-xr-x 1 dylan 197609 328 May 10 22:02 css-has-pseudo*
-rw-r--r-- 1 dylan 197609 281 May 10 22:02 css-has-pseudo.cmd
-rwxr-xr-x 1 dylan 197609 498 May 10 22:02 css-has-pseudo.ps1*
-rwxr-xr-x 1 dylan 197609 348 May 10 22:02 css-prefers-color-scheme*
-rw-r--r-- 1 dylan 197609 291 May 10 22:02 css-prefers-color-scheme.cmd
-rwxr-xr-x 1 dylan 197609 518 May 10 22:02 css-prefers-color-scheme.ps1*
-rwxr-xr-x 1 dylan 197609 330 May 10 22:02 esparse*
-rw-r--r-- 1 dylan 197609 282 May 10 22:02 esparse.cmd
-rwxr-xr-x 1 dylan 197609 500 May 10 22:02 esparse.ps1*
-rwxr-xr-x 1 dylan 197609 336 May 10 22:02 esvalidate*
-rw-r--r-- 1 dylan 197609 285 May 10 22:02 esvalidate.cmd
-rwxr-xr-x 1 dylan 197609 506 May 10 22:02 esvalidate.ps1*
-rwxr-xr-x 1 dylan 197609 330 May 10 22:02 js-yaml*
-rw-r--r-- 1 dylan 197609 282 May 10 22:02 js-yaml.cmd
-rwxr-xr-x 1 dylan 197609 500 May 10 22:02 js-yaml.ps1*
-rwxr-xr-x 1 dylan 197609 320 May 10 22:02 mkdirp*
-rw-r--r-- 1 dylan 197609 277 May 10 22:02 mkdirp.cmd
-rwxr-xr-x 1 dylan 197609 490 May 10 22:02 mkdirp.ps1*
-rwxr-xr-x 1 dylan 197609 332 May 10 22:02 postcss*
-rw-r--r-- 1 dylan 197609 283 May 10 22:02 postcss.cmd
-rwxr-xr-x 1 dylan 197609 502 May 10 22:02 postcss.ps1*
-rwxr-xr-x 1 dylan 197609 320 May 10 22:02 semver*
-rw-r--r-- 1 dylan 197609 277 May 10 22:02 semver.cmd
-rwxr-xr-x 1 dylan 197609 490 May 10 22:02 semver.ps1*
-rwxr-xr-x 1 dylan 197609 312 May 10 22:02 svgo*
-rw-r--r-- 1 dylan 197609 273 May 10 22:02 svgo.cmd
-rwxr-xr-x 1 dylan 197609 482 May 10 22:02 svgo.ps1*
-rwxr-xr-x 1 dylan 197609 316 May 10 22:02 which*
-rw-r--r-- 1 dylan 197609 275 May 10 22:02 which.cmd
-rwxr-xr-x 1 dylan 197609 486 May 10 22:02 which.ps1*

If it helps, I'm using nvm for windows, cmder, and installed hugo with scoop.

Note: this error also happened for me when trying to use some old node version. 16.x worked.