sass / embedded-host-node

A Node.js library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
MIT License
139 stars 27 forks source link

sass-embedded error with bootstrap 5.3.3 #305

Open arnriu opened 2 months ago

arnriu commented 2 months ago

Since bootstrap 5.3.3, sass-embedded throw an error. The problem was not present with bootstrap 5.3.2 and earlier, and is not present with normal sass package.

Here is the link to the open issue in bootstrap repo, with a reduced test case in a reproducible environment: https://github.com/twbs/bootstrap/issues/39978#issue-2292514748

More specifically, the problem seems to be this line. If we remove it, everything runs fine: https://github.com/twbs/bootstrap/blob/d2d4581790da2618d3fe063dafaa6205c73aabdd/scss/_variables.scss#L1751

ntkme commented 2 months ago

I tested locally with a standalone setup without vite, both new API and legacy API worked just fine. This seems to be issue only when compiling via vite as pointed out by this comment: https://github.com/twbs/bootstrap/issues/39978#issuecomment-2173495103

sass-embedded's emulated legacy API is indeed not fully compatible with sass in some corner cases. We can potentially look into what's the difference and try to fix it. However, at this point it would be much better for vite team to switch to the new API instead: https://github.com/vitejs/vite/issues/7116

nex3 commented 2 months ago

Can you provide a minimal reproduction of this that doesn't involve a bunch of external dependencies?

arnriu commented 2 months ago

Sure. Here it is without react, only vite + sass-embedded + bootstrap.

As a reminder:

https://codesandbox.io/p/devbox/competent-mahavira-forked-3jh7fj?file=%2Fpackage.json

nex3 commented 1 month ago

I'm looking for a reproduction without vite as well—for all we know, this is a bug in Vite's custom importer.