diff --git a/lib/consolidate.js b/lib/consolidate.js index 7c243d6..68126a7 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -1780,9 +1780,12 @@ exports.twing.render = function(str, options, cb) { return promisify(cb, function(cb) { var engine = requires.twing || (requires.twing = require('twing')); try { - var rendTmpl = new engine.TwingEnvironment(new engine.TwingLoaderNull()).createTemplate(str).render(options); - var tmpl = cache(options) || cache(options, rendTmpl); - cb(null, tmpl); + new engine.TwingEnvironment(new engine.TwingLoaderNull()).createTemplate(str).then((twingTemplate) => { + twingTemplate.render(options).then((rendTmpl) => { + var tmpl = cache(options) || cache(options, rendTmpl); + cb(null, tmpl); + }); + }); } catch (err) { cb(err); } diff --git a/package.json b/package.json index 04dde75..86a2d1d 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,7 @@ "test": "mocha" }, "dependencies": { - "bluebird": "^3.1.1", - "semver": "^6.3.0" + "bluebird": "^3.1.1" }, "devDependencies": { "arc-templates": "^0.5.1", @@ -69,6 +68,7 @@ "razor-tmpl": "^1.3.1", "react": "^15.6.2", "react-dom": "^15.3.2", + "semver": "^6.3.0", "should": "*", "slm": "^0.5.0", "squirrelly": "^5.0.1", @@ -79,7 +79,7 @@ "tinyliquid": "^0.2.30", "toffee": "^0.1.12", "twig": "^0.10.0", - "twing": ">=2.3.5", + "twing": "^4.0.0", "underscore": "^1.3.3", "vash": "^0.12.2", "velocityjs": "^0.8.2",