Open jimpo opened 11 years ago
Do you think this issue is related to #28?
Maybe. I remember I was getting that error and when I looked into the code I found this bug, but I don't remember if the above fixed the issue in #28 or whether I did something else.
See https://github.com/visionmedia/jade/issues/394. TJ Holowaychuk describes the rationale behind Jade's async render. This is, I believe, sort of a fundamental problem because partials have to be computed synchronously.
Or it seems you can set the jade partial renderer to use jade.compile instead of jade.render.
jade.render has the signature of an asynchronous function, using a callback instead of returning the rendered HTML. Line 297 of index.js assumes that jade.render will return HTML. My hack to get this to work is (in Coffeescript):
This only works because jade.render actually renders the template synchronously so there's no race condition, but this is super ugly and could break in future versions of Jade if jade.render actual becomes asychronous.