Dust partials rendering error in DocPad - dust.js

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 docpad#6.64
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.

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.

Related

How to electron app start with yarn berry?

After moving the code that was running well in the standalone repo to the monorepo, it is not working properly.
As shown in the screen below, the message compiled successfully appears and stopped the message last.
enter image description here
If it is executed normally, the logger message in main.ts that should appear is not visible.
If the below is really executed normally, more messages should appear.
enter image description here
And the following error window appears as if to confirm that an error occurred in main process again.
Error message is here.
A JavaScript error occurred in the main processUncaught Exception:
TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at Object.normalize (node:path:1128:5)
at contains (/Users/chai/Codes/apple/.pnp.cjs:32828:18)
at Object.ppath.contains (/Users/chai/Codes/apple/.pnp.cjs:32842:32)
at isPathIgnored (/Users/chai/Codes/apple/.pnp.cjs:41344:27)
at findPackageLocator (/Users/chai/Codes/apple/.pnp.cjs:41414:9)
at Object.findPackageLocator (/Users/chai/Codes/apple/.pnp.cjs:41706:14)
at findApiPathFor (/Users/chai/Codes/apple/.pnp.cjs:41797:41)
at Object.getApiPathFromParent (/Users/chai/Codes/apple/.pnp.cjs:41848:36)
I know that a type error occurred because the path argument that should be entered as a string entered undefined, but I cannot identify the exact location of the error.
However, considering that .pnp.cjs is a 'map' for the dependency and installation location of yarn packages, it can be assumed that there is something wrong with the package installation.
I ran into something similar and the issue was that electron was not loading my .pnp.cjs. To fix this, I add the following environment variable to my start script:
"scripts": {
"start": "NODE_OPTIONS='--require path/to/.pnp.cjs' electron ."
}

Crash on rebar3_auto

When I use rebar3_auto, it works only at the compiling, when it is running, I change code in a file to make it load, but I get the error as the following:
{undef,[{rebar3_auto,auto,
[[<<".erl">>,<<".hrl">>,<<".src">>,<<".lfe">>,
<<".config">>,<<".lock">>,<<".c">>,<<".cpp">>,<<".h">>,
<<".hpp">>,<<".cc">>]],
[]}]}
After that, changing any file does not effect the automatically compiling nor loading.
undef means the the module rebar3_auto has not been loaded. Try to run:
code:ensure_loaded('rebar3_auto').

gcov file checksums do not match when processing gcda

After using XCode 5.1, I got an error like this:
gcov: Unknown command line argument '-v'. Try: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/gcov -help'
Then I find an answer from this page: XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks
However, I got another error like this:
Processing *****.gcda
File checksums do not match: 1280071245 != 5 in ().
Invalid .gcno File!
geninfo: ERROR: GCOV failed for ****.gcda!
For me the cause was that the *.gcno files were stale and did not match the *.gcda files. In fact most of them had gone missing.
Fixed this by doing the following:
Ensured that both: 'instrument program flow' and 'generated test coverage' were set in both the App's target and the test target.
I then added the following to the AppDelegate.
- (void)applicationWillTerminate:(UIApplication *)application
{
extern void __gcov_flush(void);
__gcov_flush(); //ensure all coverage data is flushed before shutdown
}
. . this is for application hosted iOS tests. Depending on your requirements you could make this a little less 'invasive' (eg, mix in the coverage flushing so that its only in your test target), but this should be a good starting point to get it working first.

How to show mbunit/gallio TestLog or Console output in Jenkins?

I'm using Gallio/MbUnit framework for my web testing, and the tests are kicked off from Jenkins. I've installed the Gallio/MbUnit plugin and it's publishing the xml report. I'm trying to find a way to display test log or console messages in the "Test Result" section so the team can easily read failures instead of digging into the "Console Output" for any failed test run.
When I run these Gallio/MbUnit tests from my local machine using Icarus everything is pretty nicely formatted, but not so much with Jenkins. I'd like to keep using it and improve how we display the errors. Suggestions?
For a failed test:
Failed
...MainMenuTests.AcctClaimsItems
Failing for the past 4 builds (Since Failed#128 )
Took 47 sec.
add description
Error Message
Expected value to be false.Actual Value : d:\Jenkins\jobs\...\workspace\WebTesting\Base\Helpers.cs:line 90d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329true
Stacktrace
at WebTesting.Base.Helpers.Click(IWebDriver driver, IWebElement element) in
From the raw console output:
Start time: 4:21 PM
Initializing the runtime and loading plugins.
Verifying test files.
Initializing the test runner.
Running the tests.
[failed] Test WebTesting/MainMenuTests/AcctClaimsItems
Expected value to be false.
Found System.Web Exception after click to url
.../Accounting/FETReport.aspx
Actual Value : true
at WebTesting.Base.Click(IWebDriver driver, IWebElement element) in d:\Jenkins\jobs\...\workspace\WebTesting\Base\StaticHelpers.cs:line 90 at WebTesting...\Tests.MainMenuTests.AcctClaimsItems() in d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329
Code:
if (driver.PageSource.Contains("System.Web - Exception"))
{
TestLog.Write("Found exception on page {0}", driver.Url);
TestLog.Write(driver.PageSource.ToString());
Console.Write("Found exception on page {0}", driver.Url);
Console.Write(driver.PageSource.ToString());
Assert.IsFalse(driver.PageSource.Contains("System.Web - Exception"), "Found System.Web Exception after click to url {0}",driver.Url);
}
There is a general console parsing plugin you can use to add a post build step https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin

Jasmine debugging backtrace using jasmine-headless-webkit on RoR

Can I get somehow a deeper Error backtrace when I run
jasmine-headless-webkit
Running Jasmine specs...
..F
FAIL: 3 tests, 1 failure, 0.019 secs.
(/Users/User/Development/project/spec/javascripts/modal_spec.coffee:14)
TypeError: 'undefined' is not a function
I want to know where exactly in the JS the error occurs. A nice backtrace would be perfect.
As pointed out here, you can use
jasmine-headless-webkit --runner-out ~/Desktop/jasmine-out.html
to generate a nice report with nice backtrace. Just open the generated html in your favorite browser

Resources