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 transform errors with hugo extended version #56

Closed
whalekeykeeper opened this issue Jan 27, 2023 · 5 comments
Closed

CSS transform errors with hugo extended version #56

whalekeykeeper opened this issue Jan 27, 2023 · 5 comments

Comments

@whalekeykeeper
Copy link
Collaborator

whalekeykeeper commented Jan 27, 2023

Hugo local page was built successfully that the correct page can be seen locally.

But the command hugo to deploy the page for pushing to remote failed:

error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version

Hugo FAQ says:

(Q: )I get “… this feature is not available in your current Hugo version”
(A: )If you process SCSS or Sass to CSS in your Hugo project with libsass as the transpiler or if you convert images to the webp format, you need the Hugo extended version, or else you may see an error message similar to the below:

error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
We release two set of binaries for technical reasons. The extended version is not what you get by default for some installation methods. On the release page, look for archives with extended in the name. To build hugo-extended, use go install --tags extended

To confirm, run hugo version and look for the word extended.

After installing go, the go install --tags extended couldn't work because go can't find module.
At the end, by installing npm and followed the instructions on this page, extended version seems to be installed because go install works.
Though npm run start is not working, the command hugo is working.

At current stage, we have:

░▒▓ ~/Doc/G/shouchaoben  main ?6  hugo                    1 ✘  02:50:47 ▓▒░
Start building sites … 
hugo v0.110.0+extended darwin/arm64 BuildDate=unknown

                   | EN | DE  
-------------------+----+-----
  Pages            |  9 |  7  
  Paginator pages  |  0 |  0  
  Non-page files   |  0 |  0  
  Static files     | 35 | 35  
  Processed images |  0 |  0  
  Aliases          |  1 |  0  
  Sitemaps         |  2 |  1  
  Cleaned          |  0 |  0  

Total in 1252 ms

Will push to see if the GitHub Action can deploy the page correctly or not.

To record above is aiming to leave a reminder to probably upgrade Hugo's version or rethink of the theme.

@whalekeykeeper
Copy link
Collaborator Author

Another thing, hugo release page said:

If you use the legacy libsass transpiler in toCSS and uses the cached build to avoid having the extended version installed on the CI server, you need to rebuild those assets and commit them to source control (e.g. with hugo --gc).

Tried hugo --gc but it doesn't make many changes.

whalekeykeeper added a commit that referenced this issue Jan 27, 2023
`go install` doesn't work, npm was used at the end to install the extended version. See https://www.npmjs.com/package/hugo-extended.

see #56
@whalekeykeeper
Copy link
Collaborator Author

whalekeykeeper commented Jan 27, 2023

@duncdrum The last commit I am pushing was under pushing for more than 30 minutes that I need to go to sleep now. It is weird because I checked the added files are <20MB.
After I restarted GitHub Desktop for 3 times, the push suddenly finished.

whalekeykeeper added a commit that referenced this issue Jan 27, 2023
@whalekeykeeper
Copy link
Collaborator Author

whalekeykeeper commented Jan 27, 2023

CI failed and the error is:

Error: Error building site: POSTCSS: failed to transform "css/main.css" (text/css). Check your PostCSS installation; install with "npm install postcss-cli". See https://gohugo.io/hugo-pipes/postcss/: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information

From the GitHub page of our theme, I found this discussion where the suggested solution is to add a package.json file, I went to check our package.json, however it looks fine.

@whalekeykeeper
Copy link
Collaborator Author

Also tried the solution of adding a postcss.config.js file but it doesn't work.

@duncdrum
Copy link
Member

Can you open a draft PR please

whalekeykeeper added a commit that referenced this issue Jan 27, 2023
@whalekeykeeper whalekeykeeper changed the title Hugo extended version CSS transform errors with hugo extended version Jan 27, 2023
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

2 participants