seyhunak/twitter-bootstrap-rails — Issue #124: Cannot call method 'charAt' of undefined using raw less files
Author: renard
Created: 2012-02-28 14:39:24+00:00
State: open

Hi,

I got that error when using both raw bootstrap less files and less.js script.

The issue comes from sprites.less. If the sprite image is specified using:

`````
background-image: url(@iconSpritePath);
`````

The following error is generated:

`````
Cannot call method 'charAt' of undefined
in sprites.less
at Object. (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:9:9419)
at Object. (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:12000)
at w (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:6703)
at Object.entity (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:14070)
at w (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:6703)
at Object.expression (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:19055)
at w (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:6703)
at Object.value (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:17585)
at w (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:6703)
at Object.rule (http://127.0.0.1:8080/style/js/less-1.2.2.min.js:8:16106)
`````

If I change the sprite definition to:

`````
background-image: url(../img/glyphicons-halflings.png);
`````

and

`````
background-image: url(../img/glyphicons-halflings-white.png);
`````

everything goes perfectly well.

My html header is:

`````

`````

Note: The behavior is the same using lesscss 1.2.1 and 1.2.2.