I found the following example on dijit documentation:
<script type="text/javascript">
dojo.declare("MyWidget", [dijit._Widget, dijit._Templated], {
templateString: dojo.cache("myNameSpace", "templates/MyWidget.html"),
});
</script>
Try replacing the templatePath with templateString.