1
votes

I'm using DocPad with docpad-plugin-consolidate and dustjs-linkedin.

My document file is src/documents/test.html.dust:

---
layout: ltest
---
Main content!

The following template src/layouts/ltest.html.dust works fine:

Content is {content}

I want to use dust partials in my layout template in the following way:

{>"header"/}
Content is {content}
{>"footet"/}

And place templates header.dust and footer.dust somewhere nearby. But I got an error:

warning: Something went wrong while rendering: ltest.html.dust

A task's completion callback has fired when the task was already in a completed state, this is unexpected

warning: Something went wrong while rendering: test.html.dust

A task's completion callback has fired when the task was already in a completed state, this is unexpected

error: An error occured:

Error: A task's completion callback has fired when the task was already in a completed state, this is unexpected

How to fix this error?

UPD1. I created the simplest example to show the error (on Windows):

  • _http://nodejs.org/dist/v0.10.26/x64/node.exe
  • _http://nodejs.org/dist/npm/npm-1.4.3.zip
  • npm install [email protected]
  • mkdir test
  • cd test
  • docpad run
  • ; No Skeleton (20) selected; exit after run
  • docpad install consolidate
  • npm install dustjs-linkedin
  • docpad run
  • ; visit _http://localhost:9778/test.html

Here are the files: src/documents/test.html.dust

---
layout: ltest
---
Main content!

src/layouts/ltest.html.dust

Content: {content}

Until now everything works fine.

But with the following files everything goes wrong.

src/layouts/ltest.html.dust

{>"src/layouts/header.dust"/}
Content: {content}

src/layouts/header.dust

This is header

There are no errors, but output has no transformations. With debugger I found that (in dust.js 753) the function Chunk.prototype.partial is called with proper parameters and processed fine, but result is lost somewhere.

So the problem is that DocPad failed to work with partials files in dust templates.

1

1 Answers

0
votes

Can you post the header and footer templates?

Also, you have a typo in ltest.html.dust where it says "footet" instead of "footer". Don't know if that will make a difference though.