getting error after ugrading to sass-3.1.8

2019-01-24 14:20发布

after upgrading to sass-3.1.8 form sass-3.1.7 I get this error:

 Functions may only be defined at the root of a document.

any Idea how I can solve this?

I'm using some of bourbon's mixins and it's imported at the top of my stylesheets, that's all.

3条回答
男人必须洒脱
2楼-- · 2019-01-24 14:34

I have the same problem and could not solve it by modifying code.

The way I solved was to use an older version:

gem uninstall sass
gem install sass -v 3.1.1
查看更多
Lonely孤独者°
3楼-- · 2019-01-24 14:48

Ok Here is what I come up with:

SASS team decided to make a change (in this case "Functions may only be defined at the root of a document.") that made some plugins incompatible. in my case it was bourbon library. I made a ticket on github homepage of the bourbon and the owner updated the code and released a new version that's working with latest api.

I think this change should have got a bigger version bump to indicate the api change.

查看更多
SAY GOODBYE
4楼-- · 2019-01-24 14:52

Sass developer here. Mixins and functions were never meant to be allowed in a scoped context. A bug was fixed recently that caused them to be caught when in an imported file (before this fix they were only caught if defined in the primary sass file).

That said, it's not a feature we're explicitly opposed to, but we'd would need to properly test it, document it, and support it as an official feature.

查看更多
登录 后发表回答