less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

RangeError: Maximum call stack size exceeded #3614

Open looading opened 3 years ago

looading commented 3 years ago

https://github.com/less/less.js/blob/b37922cfb2932f00d1e8b340f4799ff24a2af0f2/packages/less/src/less/tree/ruleset.js#L238 Case: importRules might be a very large array, when use import Options multiple to import files which contains lots of mixins, Variable, CSS Guards and so on Error: image

LiuQingFu28 commented 3 years ago

遇到了同样的问题,请问怎么解决的

looading commented 3 years ago

遇到了同样的问题,请问怎么解决的 把上面的是实现方式修改一下,一次性改成批量塞数据

iChenLei commented 3 years ago

Hi @looading ! Can you offer a reproducation online demo or github repo? I think it's optimization question.

hugobarragon commented 1 year ago

Hi

We are having same issue when applying (multiple ) to any import using antd example to crash

body[data-theme="light"] {
  @import "antd/dist/antd.less";
  @primary-color: blue;
}

body[data-theme="dark"] {
  @import (multiple) "antd/dist/antd.less";
  @primary-color: red;
}

repo link: https://codesandbox.io/s/antd-less-example-less-js-bug-y2tiqp?file=/src/app.less:0-182

maybe realted to: https://github.com/less/less.js/issues/1928

matthew-dean commented 1 year ago

Is this possibly a circular import?