[SOLVED] Using postCSS without parameters errors when building

Hello all,

Firstly, I’m one of those that really appreciates the new Hugo Pipes (Pipelines?) for working with assets. However, I’m not able to get postCSS working on my site. I’ve pulled a minimal example together that I’ve verified works without the postCSS step, but with it, it gives me a Did not receive any STDIN error.

This is different than what it was giving me before, where it would simply error out asking for a plugin, but now with or without parameters, it gives me the above error.

Here’s a git repo with steps to reproduce and my code in the layouts/index.html file:

<html>
<head>
    {{ $toCssOpts := (dict "targetPath" "css/main.css" "outputStyle" "expanded") }}
    {{ $postCssOpts := (dict "use" "postcss-grid-kiss" "use" "autoprefixer" "autoprefixer.browsers" "> 1%, last 2 versions") }}
    {{ $styles := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | toCSS $toCssOpts | postCSS $postCssOpts | minify | fingerprint }}
    <link type="text/css" rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
</head>
<body>
{{ with .Content }}
{{ . }}
{{ end }}
</body>
</html>

Repo: https://github.com/StephenBrown2/test-hugo-postcss

./hugo version
Hugo Static Site Generator v0.45/extended linux/amd64 BuildDate: 2018-07-22T12:21:18Z
1 Like

Ah, thanks, it seems my minimal example was too simple. Also, because I had to make the example, I realized that I was relying on globally installed modules, and hugo now looks for locally installed ones first, so once I ran npm install so I had my modules populated in node_modules, my actual site is loading everything as desired, and actually running the postcss plugins now.

Thanks!

1 Like