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

Docsy initial build fails when creating new site #1075

Closed
mikeBoterf opened this issue Jun 25, 2022 · 28 comments
Closed

Docsy initial build fails when creating new site #1075

mikeBoterf opened this issue Jun 25, 2022 · 28 comments
Assignees

Comments

@mikeBoterf
Copy link
Contributor

mikeBoterf commented Jun 25, 2022

Build error

[my-linux-machine]$ hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/06/24 19:57:32 syncing static files to /
INFO 2022/06/24 19:57:32 postcss: use config file /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.3.0/postcss.config.js
INFO 2022/06/24 19:57:32 postcss: Unexpected identifier
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 312 ms

Versions

Hugo

hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

Golang

go version go1.17.7 linux/amd64

I'm not even sure where to look for the source of the issue. I am also following the docs on how to start from scratch. I don't think this is an npm package issue as I have the required modules installed globally. The issue for the missing npm which produces a similar issue was observed by myself, but I resolved that issue by installing what was missing. This site will execute under hugo server. Should I start pulling things from the example site until it works?

@marcelbaumann
Copy link

marcelbaumann commented Jun 25, 2022

Similar problem here trying to build a new site under MacOS and getting docsy on 2022-06-25 with
git clone https://github.com/google/docsy.git

Start building sites …
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/Users/Shared/Projects/tangly-os-site/themes/docsy/assets/scss/main.scss:6:1": File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

When using version 0.3.0 with

cd themes
git clone --branch v0.3.0 https://github.com/google/docsy.git
cd docsy
git submodule update --init --recursive

everything works. It seems that a later commit introduced an error.

@mikeBoterf
Copy link
Contributor Author

Similar problem here trying to build a new site under MacOS and getting docsy on 2022-06-25 with git clone https://github.com/google/docsy.git

Start building sites … hugo v0.101.0+extended darwin/amd64 BuildDate=unknown Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/Users/Shared/Projects/tangly-os-site/themes/docsy/assets/scss/main.scss:6:1": File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

When using version 0.3.0 with

cd themes git clone --branch v0.3.0 https://github.com/google/docsy.git cd docsy git submodule update --init --recursive

everything works. It seems that a later commit introduced an error.

Interesting, I wonder how many commits we'd have to comb to find the issue.

@mikeBoterf
Copy link
Contributor Author

running an sudo npm install -g postcss@^8.1.0 resolved an issue where I saw the following:

├── npx@10.2.2
├── UNMET PEER DEPENDENCY postcss@^8.1.0
└── postcss-cli@9.1.0

npm ERR! peer dep missing: postcss@^8.1.0, required by autoprefixer@10.4.7
npm ERR! peer dep missing: postcss@^8.0.0, required by postcss-cli@9.1.0
npm ERR! peer dep missing: postcss@^8.1.0, required by postcss-reporter@7.0.5

now looks like this:

npm list -g --depth 0
/usr/local/lib
├── autoprefixer@10.4.7
├── npx@10.2.2
├── postcss@8.4.14
└── postcss-cli@9.1.0

I am still seeing this:

hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/06/27 11:14:39 syncing static files to /
INFO 2022/06/27 11:14:39 postcss: use config file /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.3.0/postcss.config.js
INFO 2022/06/27 11:14:39 postcss: Unexpected identifier
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 288 ms

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jun 27, 2022

Similar problem here trying to build a new site under MacOS and getting docsy on 2022-06-25 with git clone https://github.com/google/docsy.git

Start building sites … hugo v0.101.0+extended darwin/amd64 BuildDate=unknown Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/Users/Shared/Projects/tangly-os-site/themes/docsy/assets/scss/main.scss:6:1": File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

When using version 0.3.0 with

cd themes git clone --branch v0.3.0 https://github.com/google/docsy.git cd docsy git submodule update --init --recursive

everything works. It seems that a later commit introduced an error.

Following your steps, when I cd themes/docsy/
I see the following:

hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/06/27 12:10:59 syncing static files to /
INFO 2022/06/27 12:10:59 postcss: use config file /home/michael/container-repos/hugo-docsy-test/vault-documents/themes/docsy/postcss.config.js
INFO 2022/06/27 12:10:59 postcss: Unexpected identifier
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 309 ms

is this what you were referring to?

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jun 28, 2022

Even the example site is broken:

~/repos/docsy-test$ hugo
hugo: downloading modules …
hugo: collected modules in 11911 ms
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 12749 ms

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jun 28, 2022

At this point, the only real workaround is to not attempt to build static pages. Instead just serve up some form of your repository and execute hugo server.

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jun 29, 2022

(cd themes/docsy && npm install)

> @fortawesome/fontawesome-free@5.15.4 postinstall /home/michael/container-repos/hugo-docsy-test/test-documents/themes/docsy/node_modules/@fortawesome/fontawesome-free
> node attribution.js

Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> hugo-extended@0.101.0 postinstall /home/michael/container-repos/hugo-docsy-test/test-documents/themes/docsy/node_modules/hugo-extended
> node postinstall.js

/home/michael/container-repos/hugo-docsy-test/test-documents/themes/docsy/node_modules/hugo-extended/postinstall.js:1
import install from "./lib/install.js";
       ^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Following this

@liuyueyi
Copy link

same problem, waiting for conclusion

@LisaFC LisaFC assigned LisaFC, chalin and deining and unassigned LisaFC Jun 30, 2022
@LisaFC
Copy link
Collaborator

LisaFC commented Jun 30, 2022

@chalin @deining do you have any idea what's going on here with build errors?

@stephanlachnit
Copy link
Contributor

stephanlachnit commented Jul 1, 2022

The issue is commit b6d85f5, where assets/vendor got deleted.
As you can see here:

@import "../vendor/bootstrap/scss/bootstrap";
@import "../vendor/Font-Awesome/scss/fontawesome.scss";
@import "../vendor/Font-Awesome/scss/solid.scss";
@import "../vendor/Font-Awesome/scss/brands.scss";

The main scss file tries to access those from the submodules, but they got deleted. I don't know who tested #889, but it was not tested thoroughly. The solution is even in the PR description itself but was apparently not commited.

Edit: ah right, looks like we need npm now even for static building. Tbh I prefer to revert it, as it means we need a CI image that has both hugo and npm, or need to install npm, which takes unnecessary CI time.

@chalin
Copy link
Collaborator

chalin commented Jul 1, 2022

TLDR; works for me (for details, see below) - try again with release 0.4.0.


Hi all. Firstly, release 0.4.0 is out: can you try it out and let us know if you still have issues? Now that we have an official release process, we no longer officially support docsy @HEAD -- consider it unstable.

Using release 0.4.0, I'm unable to reproduce the problems you (@mikeBoterf) reported in the opening comment. In particular, when creating a new website by following the instructions given in Prerequisites and installation and Option 1: Docsy as a Git submodule as shown here:

$ hugo new site myproject
...
$ cd myproject
$ git init
...
$ git submodule add --depth 1 https://github.com/google/docsy.git themes/docsy
...
$ echo 'theme = "docsy"' >> config.toml
$ (cd themes/docsy && npm install)
...
$ npm install -D autoprefixer postcss-cli postcss
...
$ hugo -v
Start building sites … 
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown
INFO 2022/07/01 10:28:25 syncing static files to /
...
                   | EN  
-------------------+-----
  Pages            |  7  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 40  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 1940 ms
$ hugo version
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown

Can you try these instructions and let us know if they work for you too?

@chalin
Copy link
Collaborator

chalin commented Jul 1, 2022

we need a CI image that has both hugo and npm, or need to install npm, which takes unnecessary CI time.

@stephanlachnit - for the officially supported ways of using Docsy, see Installation options. If you'd like another scenario supported, consider creating an issue or starting a discussion and I'll be glad to chime in. (In particular, I'd be curious to know how, in your setup, do you get around using npm? Don't you use it to get postcss?)

@mikeBoterf
Copy link
Contributor Author

TLDR; works for me (for details, see below) - try again with release 0.4.0.

Hi all. Firstly, release 0.4.0 is out: can you try it out and let us know if you still have issues? Now that we have an official release process, we no longer officially support docsy @HEAD -- consider it unstable.

Using release 0.4.0, I'm unable to reproduce the problems you (@mikeBoterf) reported in the opening comment. In particular, when creating a new website by following the instructions given in Prerequisites and installation and Option 1: Docsy as a Git submodule as shown here:

$ hugo new site myproject
...
$ cd myproject
$ git init
...
$ git submodule add --depth 1 https://github.com/google/docsy.git themes/docsy
...
$ echo 'theme = "docsy"' >> config.toml
$ (cd themes/docsy && npm install)
...
$ npm install -D autoprefixer postcss-cli postcss
...
$ hugo -v
Start building sites … 
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown
INFO 2022/07/01 10:28:25 syncing static files to /
...
                   | EN  
-------------------+-----
  Pages            |  7  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 40  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 1940 ms
$ hugo version
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown

Can you try these instructions and let us know if they work for you too?
Following your steps:

(cd themes/docsy && npm install)

> @fortawesome/fontawesome-free@5.15.4 postinstall /home/michael/repos/myproject/themes/docsy/node_modules/@fortawesome/fontawesome-free
> node attribution.js

Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> hugo-extended@0.101.0 postinstall /home/michael/repos/myproject/themes/docsy/node_modules/hugo-extended
> node postinstall.js

/home/michael/repos/myproject/themes/docsy/node_modules/hugo-extended/postinstall.js:1
import install from "./lib/install.js";
       ^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm WARN notsup Unsupported engine for hugo-extended@0.101.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: hugo-extended@0.101.0
npm WARN notsup Unsupported engine for careful-downloader@2.0.2: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: careful-downloader@2.0.2
npm WARN notsup Unsupported engine for read-pkg-up@9.1.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: read-pkg-up@9.1.0
npm WARN notsup Unsupported engine for log-symbols@5.1.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: log-symbols@5.1.0
npm WARN notsup Unsupported engine for fs-extra@10.1.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: fs-extra@10.1.0
npm WARN notsup Unsupported engine for is-path-inside@4.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: is-path-inside@4.0.0
npm WARN notsup Unsupported engine for tempy@2.0.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: tempy@2.0.0
npm WARN notsup Unsupported engine for compress-brotli@1.3.8: wanted: {"node":">= 12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: compress-brotli@1.3.8
npm WARN notsup Unsupported engine for is-stream@3.0.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: is-stream@3.0.0
npm WARN notsup Unsupported engine for type-fest@2.15.1: wanted: {"node":">=12.20"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: type-fest@2.15.1
npm WARN notsup Unsupported engine for unique-string@3.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: unique-string@3.0.0
npm WARN notsup Unsupported engine for crypto-random-string@4.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: crypto-random-string@4.0.0
npm WARN notsup Unsupported engine for chalk@5.0.1: wanted: {"node":"^12.17.0 || ^14.13 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: chalk@5.0.1
npm WARN notsup Unsupported engine for is-unicode-supported@1.2.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: is-unicode-supported@1.2.0
npm WARN notsup Unsupported engine for find-up@6.3.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: find-up@6.3.0
npm WARN notsup Unsupported engine for read-pkg@7.1.0: wanted: {"node":">=12.20"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: read-pkg@7.1.0
npm WARN notsup Unsupported engine for locate-path@7.1.1: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: locate-path@7.1.1
npm WARN notsup Unsupported engine for path-exists@5.0.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: path-exists@5.0.0
npm WARN notsup Unsupported engine for p-locate@6.0.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: p-locate@6.0.0
npm WARN notsup Unsupported engine for p-limit@4.0.0: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: p-limit@4.0.0
npm WARN notsup Unsupported engine for yocto-queue@1.0.0: wanted: {"node":">=12.20"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yocto-queue@1.0.0
npm WARN bootstrap@4.6.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.6.1 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependencies yourself.
npm WARN docsy@0.4.0 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hugo-extended@0.101.0 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hugo-extended@0.101.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/michael/.npm/_logs/2022-07-01T15_06_07_121Z-debug.log

@mikeBoterf
Copy link
Contributor Author

following these instructions which were updated, thank you @docsy-devs

hugo server
hugo: downloading modules …
hugo: collected modules in 15285 ms
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

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

Built in 199 ms
Watching for changes in /home/michael/repos/my-new-site/{archetypes,content,data,layouts,static}
Watching for config changes in /home/michael/repos/my-new-site/config.toml, /home/michael/repos/my-new-site/go.mod
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
^Cmichael@michael-XPS-15-9510:~/repos/my-new-site$ hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/07/01 10:10:01 syncing static files to /
INFO 2022/07/01 10:10:01 postcss: use config file /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.4.0/postcss.config.js
INFO 2022/07/01 10:10:02 postcss: Unexpected identifier
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 508 ms

@mikeBoterf
Copy link
Contributor Author

trying to cover my bases

npm install -D autoprefixer
npm WARN saveError ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm WARN autoprefixer@10.4.7 requires a peer of postcss@^8.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN my-new-site No description
npm WARN my-new-site No repository field.
npm WARN my-new-site No README data
npm WARN my-new-site No license field.

+ autoprefixer@10.4.7
added 11 packages from 9 contributors and audited 11 packages in 1.17s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities



   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New major version of npm available! 6.14.4 → 8.13.2       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v8.13.2   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

michael@michael-XPS-15-9510:~/repos/my-new-site$ npm install -D postcss-cli
npm WARN saveError ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm WARN notsup Unsupported engine for postcss-cli@10.0.0: wanted: {"node":">=14"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: postcss-cli@10.0.0
npm WARN notsup Unsupported engine for fs-extra@10.1.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: fs-extra@10.1.0
npm WARN notsup Unsupported engine for slash@4.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: slash@4.0.0
npm WARN notsup Unsupported engine for postcss-load-config@4.0.1: wanted: {"node":">= 14"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: postcss-load-config@4.0.1
npm WARN notsup Unsupported engine for get-stdin@9.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: get-stdin@9.0.0
npm WARN notsup Unsupported engine for globby@13.1.2: wanted: {"node":"^12.20.0 || ^14.13.1 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: globby@13.1.2
npm WARN notsup Unsupported engine for yargs@17.5.1: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yargs@17.5.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for yaml@2.1.1: wanted: {"node":">= 14"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yaml@2.1.1
npm WARN notsup Unsupported engine for yargs-parser@21.0.1: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: yargs-parser@21.0.1
npm WARN enoent ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm WARN autoprefixer@10.4.7 requires a peer of postcss@^8.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-cli@10.0.0 requires a peer of postcss@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-reporter@7.0.5 requires a peer of postcss@^8.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN my-new-site No description
npm WARN my-new-site No repository field.
npm WARN my-new-site No README data
npm WARN my-new-site No license field.

+ postcss-cli@10.0.0
added 59 packages from 55 contributors and audited 81 packages in 2.447s

16 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

michael@michael-XPS-15-9510:~/repos/my-new-site$ npm install -D postcss
npm WARN saveError ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/michael/repos/my-new-site/package.json'
npm WARN my-new-site No description
npm WARN my-new-site No repository field.
npm WARN my-new-site No README data
npm WARN my-new-site No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ postcss@8.4.14
added 3 packages from 38 contributors and audited 124 packages in 0.678s

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

michael@michael-XPS-15-9510:~/repos/my-new-site$ hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/07/01 10:17:50 syncing static files to /
INFO 2022/07/01 10:17:50 postcss: use config file /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.4.0/postcss.config.js
INFO 2022/07/01 10:17:50 postcss: Unexpected identifier
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 467 ms

@mikeBoterf
Copy link
Contributor Author

hugo server
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

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

Built in 192 ms
Watching for changes in /home/michael/repos/my-new-site/{archetypes,content,data,layouts,static}
Watching for config changes in /home/michael/repos/my-new-site/config.toml, /home/michael/repos/my-new-site/go.mod
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
^Cmichael@michael-XPS-15-9510:~/repos/my-new-site$ hugo 
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
Total in 456 ms

@deining
Copy link
Collaborator

deining commented Jul 1, 2022

@chalin asked:

Can you try these instructions and let us know if they work for you too?

Yes, they work for me 😄.

@deining deining removed their assignment Jul 1, 2022
@chalin
Copy link
Collaborator

chalin commented Jul 1, 2022

@mikeBoterf - Thanks for all that, but I still can reproduce it, and it's working for @deining too.

One thing comes to mind: ensure that you're using the latest LTS version of Node. I recall a project having problems when they were using an earlier version of Node. Can you update and give it another try?

@mikeBoterf
Copy link
Contributor Author

@mikeBoterf - Thanks for all that, but I still can reproduce it, and it's working for @deining too.

One thing comes to mind: ensure that you're using the latest LTS version of Node. I recall a project having problems when they were using an earlier version of Node. Can you update and give it another try?

I'll post what I have and what it upgraded to. That is probably an issue.

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jul 1, 2022

@mikeBoterf - Thanks for all that, but I still can reproduce it, and it's working for @deining too.

One thing comes to mind: ensure that you're using the latest LTS version of Node. I recall a project having problems when they were using an earlier version of Node. Can you update and give it another try?

Updating nodejs seems to have broken my nodejs path.. BUT it solved my hugo problem

hugo server
hugo: downloading modules …
hugo: collected modules in 11694 ms
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

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

Built in 199 ms
Watching for changes in /home/michael/repos/my-new-site/{archetypes,content,data,layouts,static}
Watching for config changes in /home/michael/repos/my-new-site/config.toml, /home/michael/repos/my-new-site/go.mod
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
^Cmichael@michael-XPS-15-9510:~/repos/my-new-site$ hugo 
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

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

Total in 838 ms

michael@michael-XPS-15-9510:~/repos/my-new-site$ hugo -v
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/07/01 10:45:10 syncing static files to /
INFO 2022/07/01 10:45:10 postcss: use config file /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.4.0/postcss.config.js
INFO 2022/07/01 10:45:11 postcss: 
2691:3	⚠  Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated. [autoprefixer]


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

Total in 646 ms

@mikeBoterf
Copy link
Contributor Author

I believe I for some reason installed npm.. which installed an ancient 10.x version of nodejs

I upgraded to 18 which pushed npm to 8.. I believe my npm was at a 6 or so. BUMMER

@mikeBoterf
Copy link
Contributor Author

thanks for being patient @chalin

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jul 1, 2022

nvm about the path

it's just node --version --- v18.4.0 now

@chalin
Copy link
Collaborator

chalin commented Jul 1, 2022

I'm glad that this got sorted out.

(FYI, I'll be following through with #1081.)

@mikeBoterf
Copy link
Contributor Author

mikeBoterf commented Jul 1, 2022

I'm glad that this got sorted out.

(FYI, I'll be following through with #1081.)

Hopefully nobody should have to review this issue in the future.

@kingdonb
Copy link

kingdonb commented Apr 9, 2024

@stephanlachnit Mind revisiting this with me?

#1075 (comment)

Edit: ah right, looks like we need npm now even for static building.

I have npm and hugo extended both installed, I am attempting to upgrade a site (fluxcd.io) that has been converted to use Hugo as a go module, but I am unfortunately stumped by this error:

Error: error building site: TOCSS: failed to transform "/scss/main.scss" (text/x-scss): "/Users/yebyen/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.9.1/assets/scss/main.scss:1:1": File to import not found or unreadable: ../vendor/bootstrap/scss/functions.
File to import not found or unreadable: ../vendor/bootstrap/scss/functions.

Your post with the similar error is the only thing I found that comes close! I don't understand why I get this error at all.

Sorry to bother you, but it looked like you were on the cusp of explaining something that it seems like I'll need to reckon with. I'm upgrading Docsy v0.6.0 to v0.9.0, trying to figure out the best way to include a bit of javascript in my website, but I'd like to upgrade to the latest module everywhere I can, and I see this one has a breaking upgrade of Bootstrap.

I just can't seem to get a grasp on how the go module is supposed to invoke npm, whether it did so or not; I have a bunch of mounts that seem to be aimed at this problem but I am out of my depth, and the folks who originally set up docsy have all gone. I'm afraid I don't know enough about nodejs imports to see how this is supposed to work, and the docs seem to be really slim when it comes to explaining how the go module interacts with npm.

My site repo is public, if it helps, I think this issue is a repo problem, but no way to be sure without tearing my own hair out unless I ask for help. 🤯

@fekete-robert
Copy link
Collaborator

@kingdonb I'm not using docsy as a go module much, but AFAIK when you run hugo it should download the go modules related to the project. If it doesn't, you can run hugo mod graph to display which modules are recognized as dependencies.

@kingdonb
Copy link

kingdonb commented Apr 9, 2024

This advice seems pretty well buried around notes that mention https://www.docsy.dev/docs/get-started/other-options/#docsy-npm-install-side-effect some kind of "NPM install side effect" that I should have no reason to expect when I'm using hugo as a go module, but I wonder if it has some impact. I think someone has already converted us to use docsy as a hugo module.

It looks like I am including the bootstrap 5.2.3 correctly, from hugo mod graph:

github.com/fluxcd/website github.com/google/docsy@v0.9.1
github.com/google/docsy@v0.9.1 github.com/twbs/bootstrap@v5.2.3+incompatible
github.com/google/docsy@v0.9.1 github.com/FortAwesome/Font-Awesome@v0.0.0-20240108205627-a1232e345536
github.com/fluxcd/website github.com/mfg92/hugo-shortcode-gallery@v1.1.1

I wonder if one of the mounts that was listed in my hugo.yaml has an impact on the result (removing them doesn't seem to help):

https://github.com/fluxcd/website/blob/main/hugo.yaml#L21

I wonder also if we've done some kind of reach behind the counter thing to import definitions from docsy that has somehow shot us in the foot upon upgrading. The presence of these mounts, and their absence in the docsy-example repo, gives me pause.

Anyway, thank you for responding @fekete-robert

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

No branches or pull requests

9 participants