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

Module installation broken with tip of main #1214

Closed
deining opened this issue Sep 1, 2022 · 3 comments · Fixed by #1216 or #1229
Closed

Module installation broken with tip of main #1214

deining opened this issue Sep 1, 2022 · 3 comments · Fixed by #1216 or #1229
Assignees
Labels

Comments

@deining
Copy link
Collaborator

deining commented Sep 1, 2022

As of revision 10fae88, installing docsy as module from scratch fails.

Reason:

As of this revision, scripts.html, now defines a resource $jsBs:

{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.js" -}}

This resource does not exist if you install your site from scratch without using npm.

Then the script tries to concat $jsBs (which is nil) to the resources array:

{{ $js := (slice $jsPopper $jsBs $jsBase $jsAnchor $jsSearch $jsMermaid $jsPlantuml $jsMarkmap $jsDrawio) | resources.Concat "js/main.js" -}}

This results in this error thrown when trying to display the site:

$ hugo server
hugo: collected modules in 1481 ms
Start building sites …
hugo v0.102.3-b76146b129d7caa52417f8e914fc5b9271bf56fc+extended windows/amd64 BuildDate=2022-09-01T10:16:19Z VendorInfo=gohugoio
ERROR 2022/09/01 17:09:40 render of "taxonomy" failed: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\_default\baseof.html:16:7": execute of template failed: template: _default/terms.html:16:7: executing "_default/terms.html" at <partialCached "scripts.html" .>: error calling partialCached: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\partials\scripts.html:64:117": execute of template failed: template: partials/scripts.html:64:117: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
ERROR 2022/09/01 17:09:40 render of "taxonomy" failed: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\_default\baseof.html:16:7": execute of template failed: template: _default/terms.html:16:7: executing "_default/terms.html" at <partialCached "scripts.html" .>: error calling partialCached: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\partials\scripts.html:64:117": execute of template failed: template: partials/scripts.html:64:117: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
Error: Error building site: failed to render pages: render of "home" failed: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\_default\baseof.html:16:7": execute of template failed: template: home.html:16:7: executing "home.html" at <partialCached "scripts.html" .>: error calling partialCached: "C:\Users\xxx\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\github.com\google\docsy@v0.4.1-0.20220819001812-10fae88de482\layouts\partials\scripts.html:64:117": execute of template failed: template: partials/scripts.html:64:117: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
Built in 428 ms
@deining
Copy link
Collaborator Author

deining commented Sep 2, 2022

This issue can be fixed easily by adding a mount so that bootstrap.js becomes available (see #1216) with module installations.

LisaFC added a commit that referenced this issue Sep 5, 2022
Fixes #1214.

Co-authored-by: LisaFC <lcarey@google.com>
fekete-robert pushed a commit to fekete-robert/docsy that referenced this issue Sep 13, 2022
@saurabh-sm
Copy link

I installed Docsy as a module by:

hugo new site mydocssite && cd mydocssite
hugo mod init mydocssite

and in hugo.toml:

[module]
    [[module.imports]]
        path = "github.com/google/docsy"
        disable = false

Running hugo server -D gives the below error:

ERROR render of "taxonomy" failed: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/_default/baseof.html:16:7": execute of template failed: template: _default/terms.html:16:7: executing "_default/terms.html" at <partialCached "scripts.html" .>: error calling partialCached: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/partials/scripts.html:84:30": execute of template failed: template: partials/scripts.html:84:30: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
ERROR render of "section" failed: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/_default/baseof.html:16:7": execute of template failed: template: _default/list.html:16:7: executing "_default/list.html" at <partialCached "scripts.html" .>: error calling partialCached: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/partials/scripts.html:84:30": execute of template failed: template: partials/scripts.html:84:30: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
ERROR render of "page" failed: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/_default/baseof.html:16:7": execute of template failed: template: _default/single.html:16:7: executing "_default/single.html" at <partialCached "scripts.html" .>: error calling partialCached: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/partials/scripts.html:84:30": execute of template failed: template: partials/scripts.html:84:30: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
ERROR render: failed to render pages: render of "home" failed: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/_default/baseof.html:16:7": execute of template failed: template: home.html:16:7: executing "home.html" at <partialCached "scripts.html" .>: error calling partialCached: "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/layouts/partials/scripts.html:84:30": execute of template failed: template: partials/scripts.html:84:30: executing "partials/scripts.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
Built in 26 ms
Error: error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/assets/scss/main.scss:1:1": File to import not found or unreadable: ../vendor/bootstrap/scss/functions.

I'm I using this theme as a module correctly ?

@deining
Copy link
Collaborator Author

deining commented Aug 19, 2023

I'm I using this theme as a module correctly ?

No, otherwise you weren't in trouble here 😉

Error: error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/var/folders/20/vpdszxt55fb0qdtkvrt8n4_40000gn/T/hugo_cache_me/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.7.1/assets/scss/main.scss:1:1": File to import not found or unreadable: ../vendor/bootstrap/scss/functions.

Are you really starting from scratch? Or are you trying to upgrade an existing site? If the latter is the case, do you have any local files in assets/scss? If so, can you remove these files and see if that cures your problem?

Note: Your started this thread by posting to a already closed issue. In future, please start a new issue in the discussion board for support questions.

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