I'm attempting test a simple client-side render with a pre-compiled dust template, but when I attempt to render, dust complains that it can't find my template:
[DUST WARN]: Chunk error [Error: Template Not Found: basicName] thrown. Ceasing to render this template.
My page looks like this:
<!DOCTYPE html>
<html lang="en-US">
<head>
<script type="text/javascript" src="dust-full-2.4.js"></script>
<script type="text/javascript" src="basicName.js"></script>
</head>
<body>
<div id="dustContainer"></div>
<script>
var json_payload = { "name": {
"firstName" : "Brock",
"lastName" : "Sampson"
}};
var dustContainerDiv = document.getElementById("dustContainer");
dust.render("basicName", json_payload, function(err, out) {
dustContainerDiv.innerHTML = out;
});
</script>
</body>
</html>
And my template file (basicName.tl):
<p>{name.firstName}</p><p>{name.lastName}</p>
Compiles to this (basicName.js):
(function(){dust.register("basicName.tl",body_0);function body_0(chk,ctx){return chk.write("<p>").reference(ctx.getPath(false, ["name","firstName"]),ctx,"h").write("</p><p>").reference(ctx.getPath(false, ["name","lastName"]),ctx,"h").write("</p>");}return body_0;})();
I've tested this same template/payload/html using client-side template compilation and everything works fine. What am I missing in order to be able to use pre-compiled templates?