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

Comments

Projects
None yet
@leeaston

leeaston commented Mar 11, 2012

Get this when compiling bootstrap.less:

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

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

@sirlantis

This comment has been minimized.

Show comment
Hide comment
@sirlantis

sirlantis Mar 11, 2012

Contributor

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

Contributor

sirlantis 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

This comment has been minimized.

Show comment
Hide comment
@leeaston

leeaston Mar 11, 2012

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.

leeaston commented Mar 11, 2012

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.

@thomaswinterstetter

This comment has been minimized.

Show comment
Hide comment
@thomaswinterstetter

thomaswinterstetter commented Mar 11, 2012

+1

@barryvdh

This comment has been minimized.

Show comment
Hide comment
Contributor

barryvdh commented Mar 11, 2012

@leeaston

This comment has been minimized.

Show comment
Hide comment
@leeaston

leeaston Mar 11, 2012

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

leeaston commented Mar 11, 2012

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

@barryvdh

This comment has been minimized.

Show comment
Hide comment
@barryvdh

barryvdh Mar 11, 2012

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

Contributor

barryvdh commented Mar 11, 2012

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

This comment has been minimized.

Show comment
Hide comment
@barryvdh

barryvdh Mar 11, 2012

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)

Contributor

barryvdh commented Mar 11, 2012

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

This comment has been minimized.

Show comment
Hide comment
@leeaston

leeaston Mar 11, 2012

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

leeaston commented Mar 11, 2012

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

@mdo

This comment has been minimized.

Show comment
Hide comment
@mdo

mdo Mar 11, 2012

Member

Sounds resolved. 2.0.2-wip does require LESS 1.3.

Member

mdo commented Mar 11, 2012

Sounds resolved. 2.0.2-wip does require LESS 1.3.

@mdo mdo closed this Mar 11, 2012

@davidhund

This comment has been minimized.

Show comment
Hide comment
@davidhund

davidhund Mar 12, 2012

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

davidhund commented Mar 12, 2012

@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

This comment has been minimized.

Show comment
Hide comment
@netatoo

netatoo Mar 13, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@selik

selik 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

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

This comment has been minimized.

Show comment
Hide comment
@complexthings

complexthings Mar 15, 2012

Same issues here, using Codekit

complexthings commented Mar 15, 2012

Same issues here, using Codekit

@netatoo

This comment has been minimized.

Show comment
Hide comment
@netatoo

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

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

This comment has been minimized.

Show comment
Hide comment
@complexthings

complexthings Mar 15, 2012

Thanks netatoo, works now.

complexthings commented Mar 15, 2012

Thanks netatoo, works now.

@davidhund

This comment has been minimized.

Show comment
Hide comment
@davidhund

davidhund Mar 15, 2012

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

davidhund commented Mar 15, 2012

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

@mariocloud

This comment has been minimized.

Show comment
Hide comment
@mariocloud

mariocloud Mar 16, 2012

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

mariocloud commented Mar 16, 2012

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

@klmr

This comment has been minimized.

Show comment
Hide comment
@klmr

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

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

This comment has been minimized.

Show comment
Hide comment
@cvrebert

cvrebert Feb 11, 2013

Member

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

Member

cvrebert commented Feb 11, 2013

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

@klmr

This comment has been minimized.

Show comment
Hide comment
@klmr

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

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

This comment has been minimized.

Show comment
Hide comment
@matt-bailey

matt-bailey Jun 12, 2014

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.

matt-bailey commented Jun 12, 2014

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

This comment has been minimized.

Show comment
Hide comment
@cvrebert

cvrebert Jun 12, 2014

Member

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

Member

cvrebert commented Jun 12, 2014

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