hbstack / search

HB Search Module
https://hbstack.dev/
MIT License
2 stars 0 forks source link

File to import not found or unreadable: ../../../search/scss/index #209

Open FuadEfendi opened 1 month ago

FuadEfendi commented 1 month ago

See this:

https://github.com/hbstack/search/blob/0ca1dd40726bbc72b907c80d4f28d2c40f40e0e9/assets/hb/modules/search/index.scss#L2

@import "../../../search/scss/index";

It imports non-existing file?

I have this trying to build:

ERROR TOCSS: failed to transform "/hb/modules/search/index.scss" (text/x-scss): "/Users/fefendi/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hbstack/search@v0.2.2/assets/hb/modules/search/index.scss:2:1": File to import not found or unreadable: /Users/fefendi/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugomods/search@v0.14.0/assets/search/scss/index.scss.

Maybe I need command to install "hugomods/search"? So strange, it started to happen after few upgrades

razonyang commented 1 month ago

This module already declare it's deps on https://github.com/hbstack/search/blob/0ca1dd40726bbc72b907c80d4f28d2c40f40e0e9/hugo.toml#L2

You won't need to import hugomods/search module explicitly.

Perhaps the related module is broken, the hugomods/search module wasn't downloaded completely, use the following command to check if the file exist.

cat /Users/fefendi/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugomods/search@v0.14.0/assets/search/scss/index.scss

Perhaps there is potential bug, but I couldnt reproduce, please provide reproduce steps if the file exist.

If it doens't, remove that particular module folder from local, and re-run Hugo server to re-download it.

FuadEfendi commented 1 month ago

It could be specific for SCSS compiler Mac version; I have two projects with same configuration & module versions and it happens to one of them and doesn't happen to another

 cat /Users/fefendi/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugomods/search@v0.14.0/assets/search/scss/index.scss
@import "reboot";
@import "dropdown";
@import "modal";
@import "form";
@import "result";
@import "search";
@import "shortcut";
@import "stat";
razonyang commented 1 month ago

It could be specific for SCSS compiler Mac version

It is indeed possible, you can verify this by using hugomods/hugo:exts Docker image if you have Docker installed.

cd /path/to/your-site

docker run \
  -v $PWD:/src \
  -v /Users/fefendi/Library/Caches/hugo_cache:/tmp/hugo_cache \
  hugomods/hugo:exts \
  hugo server --bind 0.0.0.0

Please note that there may be permission issue when files changed inside the container (default run as root), such as download modules, hugo stats and lock file.

I'm using github.com/sass/libsass="3.6.5" without problem.