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

Failed to Transform ; file "stdin" ; File to Import not found or unreadable. #279

Closed
dbiers opened this issue Jun 2, 2020 · 3 comments
Closed

Comments

@dbiers
Copy link

dbiers commented Jun 2, 2020

Hugo Version

Hugo Static Site Generator v0.72.0-8A7EF3CF/extended linux/amd64 BuildDate: 2020-05-31T12:14:23Z

OS Version

CentOS 8.x x64 (CentOS Linux release 8.1.1911 (Core))

Errors

[root@doc html]# pwd
/var/www/html
[root@doc html]# ls -l
total 4
drwxr-xr-x. 2 root root  24 Jun  2 17:16 archetypes
-rw-r--r--. 1 root root  93 Jun  2 17:22 config.toml
drwxr-xr-x. 2 root root   6 Jun  2 17:16 content
drwxr-xr-x. 2 root root   6 Jun  2 17:16 data
drwxr-xr-x. 2 root root   6 Jun  2 17:16 layouts
drwxr-xr-x. 8 root root 159 Aug 30  1754 public
drwxr-xr-x. 3 root root  18 Jun  2 17:18 resources
drwxr-xr-x. 3 root root  27 Jun  2 18:49 sample
drwxr-xr-x. 2 root root   6 Jun  2 17:16 static
drwxr-xr-x. 3 root root  19 Jun  2 17:18 themes
[root@doc html]# hugo
Total in 28 ms
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): SCSS processing failed: file "stdin", line 6, col 1: File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

Also attempted to run the docsy example site taken from master branch but received another error:

[root@doc docsy-example]# ./deploy.sh
Total in 12 ms
Error: Error building site: "/var/www/html/sample/docsy-example/content/en/_index.html:7:1": failed to extract shortcode: template for shortcode "blocks/cover" not found

Unsure of what I'm doing wrong, here. At first I had installed hugo using dnf or yum but then read that I needed the extended version. Downloaded and installed the extended version without issue, but still failing to build the site.

@LisaFC
Copy link
Collaborator

LisaFC commented Jun 23, 2020

Have you installed postcss? You need it to build the site assets the first time you run the build.

See our prereqs here: https://www.docsy.dev/docs/getting-started/#install-postcss

@8bitmp3
Copy link

8bitmp3 commented Jun 27, 2020

@dbiers I think there were similar issues here #235 and #242. By the way, @LisaFC thanks for your work on Docsy, this is awesome stuff.

I ran into a similar thing error message today and it turns out I didn't follow all the steps properly. I took some notes and just want to share them here, as some people may stumble upon this issue from time to time.

To avoid the Error building site: TOCSS... error when trying to build your site locally:

  • Remember to be using the extended version of Hugo. See the list of Hugo releases.
  • Don't forget to install PostCSS: $ sudo npm install -D --save autoprefixer and $ sudo npm install -D --save postcss-cli. (This is all in the official Prerequisites section.)
  • After you use git clone or git submodule add to add the Docsy theme to your /themes folder, don't forget to get local copies of the theme’s own submodules (git submodule update --init --recursive). (See the official Using the Docsy site as a Submodule.)
  • Remember to add the theme to config.toml by running $ echo 'theme = "docsy"' >> config.toml or simply add a new theme = "docsy" line to the TOML file.

Then try $ hugo server -D again.

Also, just like here in #270, it may help to upgrade Node.js to the latest version with the Node Package Manager (for example, by running $ sudo npm cache clean -f, $ sudo npm install -g n and $ sudo n stable).

@chalin
Copy link
Collaborator

chalin commented Aug 18, 2022

This seems to be similar to #464, which you can resolve by upgrading Node. For details see, Install/Upgrade Node.js. I'll close this for now, if you still have the problem, please create a new issue.

@chalin chalin closed this as completed Aug 18, 2022
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

4 participants