run app.render asynchronously

Is there a way to run app.render asynchronously?

I tried promisifying it using bluebird but I get an error

    let render = Promise.promisify(;
    html = await render('email', { email: '' });


TypeError: Cannot read property 'cache' of undefined

Author: Fantashit

1 thought on “run app.render asynchronously

  1. Okay, that link points to res.render instead of app.render, but it pointed my into the right direction.
    When I made render into it’s own variable, it lost the reference to this, so in order to fix it, you would

        const Promise = require('bluebird');
    = Promise.promisify(;
        let html = await'email', { email: '' });

    That actually works, thanks @fredski02

Comments are closed.