gohugoio/hugo

Bootstrap 4.4.1's SASS fails in Hugo

bep opened this issue · 10 comments

bep commented
SCSS processing failed: file "/var/folders/wy/g1rt5g3s5bd9flpq8g1741740000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/twbs/bootstrap@v4.4.1+incompatible/scss/_mixins.scss", line 6, col 1: File to import not found or unreadable: vendor/rfs. 

/cc @XhmikosR

bep commented

Last working version is 4.2.1.

v4.2.1 didn't have the RFS patch landed hence why it worked. I'm not familiar with how modules work here, so let me ask you a couple of things:

  1. Is the vendor folder included?
  2. Can you pass extra include options?
  3. I assume it's not a caching issue?
  4. How can we try to reproduce the issue ourselves?

/CC @MartijnCuppens for any ideas

bep commented

@XhmikosR I think I know what's happening. Will get back in a while.

bep commented

OK, so the problem is a bug in Go. I have reported it upstream and I assume it will get priority, but one never knows.

In Go Modules, the top-level /vendor directory in a module has a special meaning, so they delete it from the bundle after downloading. Sadly, their regexp (or whatever) is a little aggressive, so this folder goes as well:

https://github.com/twbs/bootstrap/tree/master/scss/vendor

Note that if you mount that folder from the project itself, you will not experience this.

There may be other workarounds until this gets fixed upstream, but you would do me a solid if you could rename this folder to something else (vendors, _vendor... whatever).

The thing is that this change can be a breaking one so we definitely can't make it in a patch version. Also, this would affect everyone else that expects the file to be there, which is something we generally try to avoid doing because it doesn't result in the best user experience.

bep commented

OK, I guess can create a "Boostrap repo wrapper" with this _rfs.scss file duplicated. O well, one more thing to maintain.

Renaming the folder will be a breaking change on our side indeed, I'm afraid we can't change that for this case.

bep commented

No worry, I actually came up with a good way to work around this.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.