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

jade-runtime.js out of date? #4

Closed
asppsa opened this issue Jul 12, 2014 · 2 comments
Closed

jade-runtime.js out of date? #4

asppsa opened this issue Jul 12, 2014 · 2 comments

Comments

@asppsa
Copy link

asppsa commented Jul 12, 2014

I'm not 100% sure whether this issue is to do with my own setup, or a problem with this module, but I think the client runtime included here is missing some functions that are needed by jade 1.3.0. As an example, suppose I have a template called test.jade (sorry for the repeated uses of "test") containing:

div(id="this is a #{test}")

Using mimosa-jade, this compiles to the 'test' key in the templates object as:

templates['test'] = function template(locals) {
var buf = [];
var jade_mixins = {};
var jade_interp;
;var locals_for_with = (locals || {});(function (test) {
buf.push("<div" + (jade.attr("id", "This is a " + (test) + "", true, false)) + "></div>");}("test" in locals_for_with?locals_for_with.test:typeof test!=="undefined"?test:undefined));;return buf.join("");
}

Then in my app, I do:

require(['templates'], function (templates) {
  console.log(templates.test({test: "success"}));
});

This causes an error: TypeError: jade.attr is not a function. jade is apparently the client runtime, and it looks like it is missing the attr method, which is used here to build the "id" attribute. This method is present in more recent versions of the runtime at visionmedia/jade, so I think the problem may come from mimosa-jade having its own copy of the runtime.

@dbashford
Copy link
Owner

I've updated jade-runtime to latest, also updated jade to 1.3.1. Published. Let me know how it goes!

@asppsa
Copy link
Author

asppsa commented Jul 12, 2014

Great, that fixes it! 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