You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As with Zappa 0.3.x using @render together with an extending Jade Template will result in an ENOENT Error.
Using @response.render will work though.
It took me a while to nail it down to this line: https://github.com/mauricemach/zappa/blob/master/src/zappa.coffee#L274
In the long run it changes the value for filename being passed to jade,
such that the contextId is prepended to the templates name.
As the extend option in Jade templates uses the filename to determine the base file,
it will look up the modified filename and obviously not be able to find the required base template.
Example:
base.jade
html
head
blockhead
body
blockcontent
extension.jade
extendsbaseblockcontent
p some text here
So now when processing with contextId = 12345 jade will lookup path/to/views/12345/base.jade instead of path/to/views/base.jade
I hope that's clear enough ;)
Does anyone have a clue how to fix this other than using @response.render?
The text was updated successfully, but these errors were encountered:
It also seems to me that any Jade error is hidden behind this ENOENT error.
According to the comments in zappa/src/zappa.coffee (line 271), adding the contextId is needed to let Express use inline views defined in the application.
On my side, I temporarily commented line 445 in zappa/lib/zappa.js to be able to see Jade errors.
//args[0] = context.id + '/' + args[0];
I guess checking if the view file exists and only transmit contextId if it doesn't should be a clean workaround.
Hi Folks,
As with Zappa 0.3.x using
@render
together with an extending Jade Template will result in an ENOENT Error.Using
@response.render
will work though.It took me a while to nail it down to this line:
https://github.com/mauricemach/zappa/blob/master/src/zappa.coffee#L274
In the long run it changes the value for filename being passed to jade,
such that the
contextId
is prepended to the templates name.As the
extend
option in Jade templates uses the filename to determine the base file,it will look up the modified filename and obviously not be able to find the required base template.
Example:
base.jade
extension.jade
So now when processing with
contextId = 12345
jade will lookup path/to/views/12345/base.jade instead of path/to/views/base.jadeI hope that's clear enough ;)
Does anyone have a clue how to fix this other than using
@response.render
?The text was updated successfully, but these errors were encountered: