Bootstrap.less compile error
Get this when compiling bootstrap.less:
syntax Error on line 488 Filename: /less/mixins.less
Line 488: (~".span@{index}") { .span(@index); }
Assuming that you are using the 2.0.2-wip branch you need to install less.js v1.3.0 (released yesterday).
Thanks for the info. Do you happen to know of a way that I can compile it so I can have a .css file on the server. I was using http://crunchapp.net/ before, but now now get the compile error.
+1
http://lesscss.org/#-client-side-usage
Thanks Barry, but we're after a way to compile less and serve css form the server.
When you scroll down, there is a server-side usage and a command line usage
Command-line usage Less comes with a binary, which lets you invoke the compiler from the command-line, as such: $ lessc styles.less
Or something like http://wearekiss.com/simpless and replace the Rescources/js/less.js with the 1.3.0 version (don't know if that works)
Thanks Barry, appreciate you digging a bit deeper! I'll give it a go...
Sounds resolved. 2.0.2-wip does require LESS 1.3.
@markdotto I have just tested this with a fresh install of Less (lessc) 1.3.0 and TB 2.0.2 WIP (cloned Mon Mar 12 14:09:38 2012 -0700)
I still get:
NameError: #grid > .core is undefined in grid.less:2:0
1 // Fixed (940px)
2 #grid > .core(@gridColumnWidth, @gridGutterWidth);
3
I am also running into some issues where Less is not compiling my Bootstrap in-a-sub-folder
My current folder setup is:
project/[...]/
project/static/less/bootstrap/less/*.less ( all Bootstrap less files )
project/static/less/my-project.less ( @imports "bootstrap/less/bootstrap.less" )
project/static/css/my-project.css ( output CSS )
When compiling (Less 1.2.1 through CodeKit) it throws the following warning:
TypeError: Cannot call method 'charAt' of undefined
at getLocation (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:212:34)
at new LessError (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:221:19)
at Object.toCSS (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:381:31)
at /Applications/CodeKit.app/Contents/Resources/engines/less/bin/lessc:102:28
at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:430:40
at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:94:48
at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/index.js:115:15
at Object.parse (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:432:17)
at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/index.js:114:14
at [object Object].<anonymous> (fs.js:107:5)
This error, I think relates to https://github.com/cloudhead/less.js/issues/592
However: when I move my project .less file into the bootstrap/less/ folder I get a different error:
NOTE: compiling through lessc (1.2.1 AND 1.3.0) gives the same error.
For me, i've the same error until i've updated LESS to 1.3.0. Now I have no error.
Same error:
lessc ./less/bootstrap.less > ./docs/assets/css/bootstrap.css NameError: #grid > .core is undefined in /Users/mike/github/bootstrap/less/grid.less:2:0 1 // Fixed (940px) 2 #grid > .core(@gridColumnWidth, @gridGutterWidth); 3
Using bootstrap and less.js master branches downloaded 2012 03 13, 2:45 pm EST
Same issues here, using Codekit
CodeKit seems to use LESS v1.2.*.. Try to update LESS manually on /CodeKit.app/Contents/Resources/engines/less. Works for me.
Thanks netatoo, works now.
Guys @bdkjones will update CodeKit very soon (this week?) with the new Less 1.3.0: see https://github.com/bdkjones/CodeKit/issues/255#issuecomment-4485992
I was having the same problem. I've updated LESS to 1.3.0 and now it is working fine. Thanks.
Can we please reopen this issue? It still persists. Here’s the steps to repro it:
$ git clone git://github.com/twitter/bootstrap.git
…
$ lessc --version
lessc 1.3.0 (LESS Compiler) [Ruby] 2.2.2
$ cd bootstrap/less/
$ lessc bootstrap.less
at less.Parser.parser.parse.i (/usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less/js/lib/less/parser.js:385:31):
#grid > .core is undefined (Less::ParseError)
… and using the provided Makefile doesn’t work at all since the Makefile assumes hard-coded paths for the executables (such as recess) – for instance:
$ make bootstrap-css
mkdir -p bootstrap/css
./node_modules/.bin/recess --compile ./less/bootstrap.less > bootstrap/css/bootstrap.css
/bin/sh: ./node_modules/.bin/recess: No such file or directory
make: *** [bootstrap/css/*.css] Error 127
– not surprising, since ./node_modules/.bin is nowhere defined and the build instructions in README.md give no hint about this requirement. In fact, maybe README.md could be amended to include this information, or (preferred) the Makefile could be fixed not to use hard-coded paths.
(Incidentally, manually invoking recess rather than lessc on the files works.)
@klmr: Your first problem is #6871. Your second problem is #6870/#6576.
@cvrebert Ah thanks. Now I’m puzzled that the Ruby gem less apparently doesn’t find my npm installation and does something in parallel, since I had the most up to date less gem installed. Well, never mind.