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

I get "Unexpected token {" error at line 24 if(chart != null && chartData.pc != null) { #1

Open
HarleyGolfGuy opened this issue Feb 11, 2014 · 3 comments

Comments

@HarleyGolfGuy
Copy link

Express
500 SyntaxError: C:\Users\Set\NodeProjects\realchart\views\index.jade:24
22| var actualDate = new Date();
23| function addChartData(chartData) {
> 24| if(chart != null && chartData.pc != null) {
25| var index = serieIndex(chartData.pc);
26| var series;
27| if(index >= 0) {

Unexpected token {
22| var actualDate = new Date();
23| function addChartData(chartData) {

24| if(chart != null && chartData.pc != null) {
25| var index = serieIndex(chartData.pc);
26| var series;
27| if(index >= 0) {
Unexpected token {
at Function (:null:null)
at assertExpression (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\lexer.js:30:3)
at Object.Lexer.conditional (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\lexer.js:493:11)
at Object.Lexer.next (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\lexer.js:847:15)
at Object.Lexer.lookahead (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\lexer.js:113:46)
at Parser.lookahead (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:111:23)
at Parser.peek (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:88:17)
at Parser.block (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:656:30)
at Parser.tag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:777:26)
at Parser.parseTag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:690:17)
at Parser.parseExpr (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:199:21)
at Parser.block (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:660:25)
at Parser.tag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:777:26)
at Parser.parseTag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:690:17)
at Parser.parseExpr (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:199:21)
at Parser.block (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:660:25)
at Parser.parseBlock (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:462:14)
at Parser.parseExpr (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:203:21)
at Parser.block (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:660:25)
at Parser.tag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:777:26)
at Parser.parseTag (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:690:17)
at Parser.parseExpr (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:199:21)
at Parser.parse (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\parser.js:131:25)
at parse (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\jade.js:95:62)
at Object.exports.compile (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\jade.js:152:9)
at Object.exports.render (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\jade.js:256:15)
at Object.exports.renderFile (C:\Users\Set\NodeProjects\realchart\node_modules\jade\lib\jade.js:293:18)
at View.exports.renderFile as engine
at View.render (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\view.js:76:8)
at Function.app.render (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\application.js:504:10)
at ServerResponse.res.render (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\response.js:798:7)
at C:\Users\Set\NodeProjects\realchart\server.coffee:94:7
at callbacks (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\router\index.js:164:37)
at param (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\router\index.js:138:11)
at pass (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\router\index.js:145:5)
at Router._dispatch (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\router\index.js:173:5)
at Object.router (C:\Users\Set\NodeProjects\realchart\node_modules\express\lib\router\index.js:33:10)
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at Object.stylus (C:\Users\Set\NodeProjects\realchart\node_modules\stylus\lib\middleware.js:194:7)
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at Object.methodOverride as handle
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at multipart (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\middleware\multipart.js:97:37)
at C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\middleware\bodyParser.js:64:9
at urlencoded (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\middleware\urlencoded.js:41:37)
at C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\middleware\bodyParser.js:62:7
at json (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\middleware\json.js:42:37)
at Object.bodyParser as handle
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at Object.expressInit as handle
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at Object.query as handle
at next (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:193:15)
at Function.app.handle (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\proto.js:201:3)
at Server.app (C:\Users\Set\NodeProjects\realchart\node_modules\express\node_modules\connect\lib\connect.js:65:37)
at Manager.handleRequest (C:\Users\Set\NodeProjects\realchart\node_modules\socket.io\lib\manager.js:565:28)
at Server. (C:\Users\Set\NodeProjects\realchart\node_modules\socket.io\lib\manager.js:119:10)
at Server.EventEmitter.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2056:12)
at HTTPParser.parserOnHeadersComplete as onHeadersComplete
at Socket.socket.ondata (http.js:1946:22)
at TCP.onread (net.js:525:27)

@acehege
Copy link
Contributor

acehege commented Feb 14, 2014

I am getting the exact same error:

SyntaxError: /realchart/views/index.jade:24
22| var actualDate = new Date();
23| function addChartData(chartData) {

24| if(chart != null && chartData.pc != null) {
25| var index = serieIndex(chartData.pc);
26| var series;
27| if(index >= 0) {

Unexpected token {
at Function ()
at assertExpression (/realchart/node_modules/jade/lib/lexer.js:30:3)
at Object.Lexer.conditional (/realchart/node_modules/jade/lib/lexer.js:493:11)
at Object.Lexer.next (/realchart/node_modules/jade/lib/lexer.js:847:15)
at Object.Lexer.lookahead (/realchart/node_modules/jade/lib/lexer.js:113:46)
at Parser.lookahead (/temp/realchart/node_modules/jade/lib/parser.js:111:23)
at Parser.peek (/temp/realchart/node_modules/jade/lib/parser.js:88:17)
at Parser.block (/temp/realchart/node_modules/jade/lib/parser.js:656:30)
at Parser.tag (/realchart/node_modules/jade/lib/parser.js:777:26)
at Parser.parseTag (/realchart/node_modules/jade/lib/parser.js:690:17)

@bonomat
Copy link
Owner

bonomat commented Apr 4, 2014

can't reproduce that error, it works for me with:

CoffeeScript version 1.7.1
Node version v0.10.26
npm version 1.4.3

@mirkoperillo
Copy link

I think this error is caused by a wrong spacing in jade file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants