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

get illegal token error #210

Open
hajika opened this issue May 17, 2017 · 10 comments
Open

get illegal token error #210

hajika opened this issue May 17, 2017 · 10 comments

Comments

@hajika
Copy link
Contributor

hajika commented May 17, 2017

I suddenly get this error when opening jingo:

SyntaxError: Unexpected token ILLEGAL
    at Function (native)
    at wrap (/home/user/jingo/node_modules/pug/node_modules/pug-runtime/wrap.js:8:30)
    at Object.exports.compile (/home/user/jingo/node_modules/pug/lib/index.js:263:7)
    at handleTemplateCache (/home/user/jingo/node_modules/pug/lib/index.js:216:25)
    at Object.exports.renderFile (/home/user/jingo/node_modules/pug/lib/index.js:418:10)
    at Object.exports.renderFile (/home/user/jingo/node_modules/pug/lib/index.js:408:21)
    at View.exports.__express [as engine] (/home/user/jingo/node_modules/pug/lib/index.js:455:11)
    at View.render (/home/user/jingo/node_modules/express/lib/view.js:128:8)
    at tryRender (/home/user/jingo/node_modules/express/lib/application.js:640:10)
    at EventEmitter.render (/home/user/jingo/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/user/jingo/node_modules/express/lib/response.js:966:7)
    at ServerResponse.res.render (/home/user/jingo/node_modules/express-flash/lib/express-flash.js:29:16)
    at /home/user/jingo/lib/app.js:199:9
    at Layer.handle_error (/home/user/jingo/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/home/user/jingo/node_modules/express/lib/router/index.js:315:13)
    at /home/user/jingo/node_modules/express/lib/router/index.js:284:7

I already completely reinstalled jingo and created a new repo, but the error is still there. I cant imagine why?! As far as I know, that can happen when there is an invisible character in JS code, but how suddenly and why its not working after reinstallation?

@claudioc
Copy link
Owner

@hajika ouch, this sounds bad. Can you give me a bit more details? When is that you get that? On starting jingo, on loading the first page or somewhere else?

thanks!

@hajika
Copy link
Contributor Author

hajika commented May 19, 2017

I get this on opening any page. I checked the wrap.js in the meantime, and it actually complains about the last + (that is the sign in wrap.js:8:30). When I remove the last two +, it will complain about the other plus. Strange.

var runtime = require('./');

module.exports = wrap;
function wrap(template, templateName) {
  templateName = templateName || 'template';
  return Function('pug',
    template + '\n' +
    'return ' + templateName + ';'
  )(runtime); 
}

It might be because of the template variable, I put it in a console.log() and got a very long output with actual code, I guess thats not intended? What should be in the template var? I will attach the output here to give you a hint (everything between the xxx):

jingolog.txt

@claudioc
Copy link
Owner

Thanks, but this is still not enough: can you please send me also your config.yaml? What is your server (or workstation) configuration? Windows maybe?

@hajika
Copy link
Contributor Author

hajika commented May 19, 2017

CentOs 6

As I said, I completely reinstalled the whole thing, in the config.yaml I only changed the port and the repository path, anything else is like in the default. I also initiated a new git repo.

@hajika
Copy link
Contributor Author

hajika commented May 20, 2017

So I still encounter that problem with the master branch, but not with the v1.7.3, so I hope this will vanish with the next release :)

@claudioc
Copy link
Owner

It must have something to do with the 1.8.0 release, then (there were big changes there), but I cannot reproduce it on OSX and Ubuntu at the moment.

One of the templates is probably broken somehow but I can't understand where the problem is.

@claudioc
Copy link
Owner

In the meanwhile try the current version (1.8.1)

@claudioc
Copy link
Owner

Can you also please tell me you node js version?

@hajika
Copy link
Contributor Author

hajika commented May 24, 2017

I just tried the v1.8.2 and the error appears again. Node version is v0.12.9, but I can change I easily if there is any benefit in it..

@claudioc
Copy link
Owner

I am pretty sure Node 0.x is not supported anymore, or not supported very well at least.

Please use any of the LTS (since you are updating, go for 6.x)

Thanks

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

2 participants