Error building site: TOCSS: failed to transform "scss/style.scss" (text/x-scss

Hello, I am trying to use this theme.

I have Hugo Extended version
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended darwin/arm64 BuildDate=2023-11-08T11:18:07Z VendorInfo=brew

When I try to launch the server I get these errors. I can’t figure out what is causing them.

WARN  found no layout file for "html" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
ERROR render of "page" failed: "/Users/1/hugo/quick/themes/bridget/layouts/_default/single.html:13:8": execute of template failed: template: _default/single.html:13:8: executing "main" at <partial "nav.html" .>: error calling partial: "/Users/1/hugo/quick/themes/bridget/layouts/partials/nav.html:8:16": execute of template failed: template: partials/nav.html:8:16: executing "partials/nav.html" at <len $menus>: error calling len: reflect: call of reflect.Value.Type on zero Value
ERROR render: failed to render pages: render of "page" failed: "/Users/1/hugo/quick/themes/bridget/layouts/_default/single.html:13:8": execute of template failed: template: _default/single.html:13:8: executing "main" at <partial "nav.html" .>: error calling partial: "/Users/macstudio/hugo/quick/themes/bridget/layouts/partials/nav.html:8:16": execute of template failed: template: partials/nav.html:8:16: executing "partials/nav.html" at <len $menus>: error calling len: reflect: call of reflect.Value.Type on zero Value
Built in 21 ms
Error: error building site: TOCSS: failed to transform "scss/style.scss" (text/x-scss): "/Users/1/hugo/quick/themes/bridget/assets/scss/style.scss:10:1": File to import not found or unreadable: node_modules/swiper/swiper.scss.

Any ideas?

The first two errors arise with an imcomplete/non-existing menu. Probably. As you’re not showing your code, it’s just a wild guess. For more accurate help, post a link to your repository, please.

And apparently, some npm module called swiper is needed in your setup (that’s what the error message says – no mystery there). So you might want to install that, if you want to use it.

I have linked to the theme that I am trying to install. I haven’t altered any code, just trying to get it to work out of the box. I have followed all the installation instructions. Perhaps there is a step missing?

For example how to install swiper.
I ran this command: npm I swiper

But it did not help. Still have the same error messages.

Perhaps you should talk to the theme author then.

1 Like

I fixed it.

I downloaded node_modules and added it to the themes scss folder. Then it was able to build. Hope it helps someone.