Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS build issues #210

Closed
stephenplatz opened this issue Jun 2, 2020 · 9 comments
Closed

CSS build issues #210

stephenplatz opened this issue Jun 2, 2020 · 9 comments

Comments

@stephenplatz
Copy link

stephenplatz commented Jun 2, 2020

I thought I'd open an issue here, although I'm not sure if this could actually be related to gohugoio/hugo#7278 (comment). In any case, I'm still getting the POSTCSS: failed to transform "css/main.css" error when I try to build the site, despite making sure all of the dependencies in the documentation are installed.

I'm not actually using a snap installation of Hugo, though Hugo Static Site Generator v0.71.1-A301F6B2/extended linux/amd64 BuildDate: 2020-05-25T09:18:12Z

@mijorus
Copy link
Contributor

mijorus commented Jun 10, 2020

check if you installed npm dependencies properly, I had the same issue

you need to run npm commands inside the hugo projects

@robgravy
Copy link

I'm getting this error also. I've created a new hugo site and added this theme as a submodule. I'm able to serve locally, but not able to build.

My environment:

  • node v12.18.1
  • Hugo Static Site Generator v0.72.0/extended darwin/amd64 BuildDate: unknown
Error: Error building site: POSTCSS: failed to transform "css/main.css" (text/css): resource "sass/sass/style.sass_b1195a7e151e6f4379f823b1b2b4f87a" not found in file cache

@robgravy
Copy link

Ok nvm I was able to fix this by reading this post. I ran these two commands and I was able to build:

sudo npm i -g postcss-cli
sudo npm i -g autoprefixer

@victoriadrake
Copy link
Owner

Thank you for sharing @gray419!

@eauchat
Copy link

eauchat commented Jun 24, 2020

Hello, I'm having the same issue, using the theme via gitlab-ci.
Would anyone have a suggestion on how the issue could be solved in that context? I don't know if the solution proposed by @gray419 can be applied in such docker environment.

@mike-foucault
Copy link

mike-foucault commented Jun 30, 2020

@eauchat , I fixed the same issue by adding a package.json file, with the following content :

{
  "name": "netlify-deps",
  "version": "0.1.0",
  "dependencies": {
    "postcss-cli": "7.1.1",
    "autoprefixer": "9.8.4"
  }
}

I did not try with gitlab-ci, I use netlify. By default, Netlify runs npm install to install the dependencies listed in my package.json file. So, if you configure your CI to install the dependencies, the issue will be solved.

@dannie-ml
Copy link

i've already done all your solutions and not worked for me ;(

@victoriadrake
Copy link
Owner

i've already done all your solutions and not worked for me ;(

@dannie-ml If you provide some error feedback, information about your set up, or a link to your site repository, we can try and help! 😄

@DuaneOBrien
Copy link

For folks who find this issue because they are still tripping over the error:

POSTCSS: failed to transform "css/main.css"

I added the package.json shown in this comment and I still had the error, because I forgot to run:

npm install

This cleared the error for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants