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

when passing a variable named 'client' in res.render, jade throws an error #914

Closed
maxwellium opened this issue Mar 7, 2013 · 6 comments

Comments

@maxwellium
Copy link

reproduced this across several projects, using current jade version

also experienced by others:

http://stackoverflow.com/questions/10618427/railway-js-jade-crashes-when-a-route-to-client-is-defined#11496334

@ForbesLindesay
Copy link
Member

Client is an option, it triggers compiling, but not rendering the template, so that you get a JavaScript function you can render on the client. Unfortunately all I can suggest is that you name the variable something else. We could possibly improve documentation in this area though.

@maxwellium
Copy link
Author

is that an express option or jade-specific? shouldn't we separate option passing from variable passing?

@ForbesLindesay
Copy link
Member

Most template libraries do just mix them in one big object like jade does. It's jade specific, although I imagine if people start adapting other template libraries to support compiling for client side use we'll see a lot more libraries have the same issue.

@ForbesLindesay
Copy link
Member

In 2.0.0 we can completely remove the client option and allow you to use it just like any other local.

@ForbesLindesay ForbesLindesay added this to the 2.0.0 milestone Apr 5, 2014
@maxwellium
Copy link
Author

<3

@ForbesLindesay
Copy link
Member

This will be looked at in 2.0.0

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

No branches or pull requests

2 participants