question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ParseError: expected "indent", got "outdent" (using hashes)

See original GitHub issue

The following Stylus fails when not using a colon after background-color but works with one:

Failure

$Colors = {'Red': #ff0000}

body
    background-color $Colors.Red
> stylus < test.styl 

/usr/local/lib/node_modules/stylus/bin/stylus:494
      if (err) throw err;
                     ^
ParseError: stdin:4
   1| $Colors = {'Red': #ff0000}
   2| 
   3| body
 > 4|     background-color $Colors.Red
   5| 

expected "indent", got "outdent"

    at Parser.error (/usr/local/lib/node_modules/stylus/lib/parser.js:179:11)
    at Parser.expect (/usr/local/lib/node_modules/stylus/lib/parser.js:207:12)
    at Parser.block (/usr/local/lib/node_modules/stylus/lib/parser.js:688:12)
    at Parser.selector (/usr/local/lib/node_modules/stylus/lib/parser.js:1224:24)
    at Parser.property (/usr/local/lib/node_modules/stylus/lib/parser.js:1175:47)
    at Parser.ident (/usr/local/lib/node_modules/stylus/lib/parser.js:1130:25)
    at Parser.stmt (/usr/local/lib/node_modules/stylus/lib/parser.js:632:26)
    at Parser.statement (/usr/local/lib/node_modules/stylus/lib/parser.js:540:21)
    at Parser.block (/usr/local/lib/node_modules/stylus/lib/parser.js:700:21)
    at Parser.selector (/usr/local/lib/node_modules/stylus/lib/parser.js:1224:24)

Success

$Colors = {'Red': #ff0000}

body
    background-color: $Colors.Red
> stylus < test.styl 
body {
  background-color: #f00;
}

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:2
  • Comments:25 (15 by maintainers)

github_iconTop GitHub Comments

8reactions
cjaoudecommented, Nov 7, 2016

guys, missing the obvious… you could go the array notation route, works just fine

body = { p: 'foo' }

html
  prop  body['p']    <-- use array, no colon
1reaction
capricubecommented, Mar 4, 2015

i just run into the same problem. maybe the documentation on the hashes should be extended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stylus ParseError: expected "indent", got "outdent"
Usually, it has to do with a nearby rule that contains a filter property. When a rule contains any Microsoft "progid" you need...
Read more >
Node.js – Stylus ParseError: expected “indent”, got “outdent”
The problem here is error reporting more than anything else. Dots . are not allowed in stylus variable names (nor mixin names), so...
Read more >
[Solved]-Stylus ParseError: expected “indent”, got “;”-grunt.js
I had a similar issue but there was no identifyable character and the error kept moving lines whenever I would delete one. Turns...
Read more >
Perltidy Change Log - SourceForge
One indentation space is removed to improve alignment: # OLD: perltidy -xlp ... ($expected)"); - Fix for issue git #105, incorrect formatting with...
Read more >
Lightning Aura Components Developer Guide
Get Your Aura Components Ready to Use on Lightning Pages . ... Data updates behave as you would expect in JavaScript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found