Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap.less compile error #2516

Closed
leeaston opened this issue Mar 11, 2012 · 22 comments
Closed

Bootstrap.less compile error #2516

leeaston opened this issue Mar 11, 2012 · 22 comments

Comments

@leeaston
Copy link

Get this when compiling bootstrap.less:

syntax Error on line 488
Filename: /less/mixins.less

Line 488: (~".span@{index}") { .span(@Index); }

@mrcljx
Copy link

mrcljx commented Mar 11, 2012

Assuming that you are using the 2.0.2-wip branch you need to install less.js v1.3.0 (released yesterday).

@leeaston
Copy link
Author

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.

@winterstetter
Copy link

+1

@barryvdh
Copy link
Contributor

@leeaston
Copy link
Author

Thanks Barry, but we're after a way to compile less and serve css form the server.

@barryvdh
Copy link
Contributor

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

@barryvdh
Copy link
Contributor

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)

@leeaston
Copy link
Author

Thanks Barry, appreciate you digging a bit deeper! I'll give it a go...

@mdo
Copy link
Member

mdo commented Mar 11, 2012

Sounds resolved. 2.0.2-wip does require LESS 1.3.

@mdo mdo closed this as completed Mar 11, 2012
@davidhund
Copy link

@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 less/less.js#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.

@netatoo
Copy link

netatoo commented Mar 13, 2012

For me, i've the same error until i've updated LESS to 1.3.0. Now I have no error.

@selik
Copy link

selik commented Mar 13, 2012

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

@complexthings
Copy link

Same issues here, using Codekit

@netatoo
Copy link

netatoo commented Mar 15, 2012

CodeKit seems to use LESS v1.2.*.. Try to update LESS manually on /CodeKit.app/Contents/Resources/engines/less. Works for me.

@complexthings
Copy link

Thanks netatoo, works now.

@davidhund
Copy link

Guys @bdkjones will update CodeKit very soon (this week?) with the new Less 1.3.0: see bdkjones/CodeKit#255 (comment)

@mariocloud
Copy link

I was having the same problem. I've updated LESS to 1.3.0 and now it is working fine. Thanks.

@klmr
Copy link

klmr commented Feb 11, 2013

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.)

@cvrebert
Copy link
Collaborator

@klmr: Your first problem is #6871. Your second problem is #6870/#6576.

@klmr
Copy link

klmr commented Feb 11, 2013

@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.

@matt-bailey
Copy link

This issue still persists. I started work on an old project today and I'm setting up a Grunt workflow.

  • The Bootstrap version is 2.0.4
  • I'm using grunt-contrib-less to compile
  • By default grunt-contrib-less installs Less 1.7.0 as a dependency
  • I've tried changing the Less node module that grunt-contrib-less installs to 1.3.0-3

All the versions of Less I've tried produce variations on the same error:

NameError: #grid > .core > .span is undefined in...

Any help/advice would be greatly appreciated, thanks.

@cvrebert
Copy link
Collaborator

@matt-bailey Bootstrap v2 has not been officially supported for a while. Please ask on StackOverflow instead.

@twbs twbs locked and limited conversation to collaborators Jun 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests