You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you dynamic load it using: <link rel="stylesheet/less" href="assets/less/bootstrap.less"> <script src="assets/js/less-1.2.2.js"></script>
... with less 1.2.2 you get:
Cannot call method 'charAt' of undefined
in sprites.less
at Object. (http://localhost:8000/assets/js/less-1.2.2.js:2873:47)
at Object. (http://localhost:8000/assets/js/less-1.2.2.js:766:28)
...
at Object.rule (http://localhost:8000/assets/js/less-1.2.2.js:1157:33)
Notice that it all works with "lessc"!!! It is a problem only with dynamic loading.
This was the subject of issue #623 which was closed without being solved.
(Possibly because @Anahkiasen turned to using lessc???)
Anahkiasen reported he no longer has an error when he quotes the variables, but not having an error does not means the variables are now resolved. What happens when you replace this less code: background-image: url(@iconSpritePath);
...by the quoted variant which Anahkiasen mentions on
At twitter bootstrap you have a couple of variable used to fill in url()s.
They are declared here:
and look like this:
And they are used here:
on a bit of code looking like this:
If you dynamic load it using:
<link rel="stylesheet/less" href="assets/less/bootstrap.less">
<script src="assets/js/less-1.2.2.js"></script>
... with less 1.2.2 you get:
...which refers to:
https://github.com/cloudhead/less.js/blob/master/dist/less-1.2.2.js#L2873
where you can find this line of code from the tree.URL() function:
So, apparently the variable was not resolved.
Notice that it all works with "lessc"!!! It is a problem only with dynamic loading.
This was the subject of issue #623 which was closed without being solved.
(Possibly because @Anahkiasen turned to using lessc???)
Anahkiasen reported he no longer has an error when he quotes the variables, but not having an error does not means the variables are now resolved. What happens when you replace this less code:
background-image: url(@iconSpritePath);
...by the quoted variant which Anahkiasen mentions on
...is this:
background-image: url("@iconSpritePath");
...is that you simply get this CSS output:
background-image: url("@iconSpritePath");
So, no error but no proper variable resolution either since Less just interprets the quoted variant as a literal instead of as a variable.
The text was updated successfully, but these errors were encountered: