Verify if Spacebars HTML syntax is correct

41 Views Asked by At

I have a project using a Meteor + Blaze + Spacebars stack.

Whenever I have an error inside one of the HTML files (which are processed with Spacebars), the html is not loaded on the client. This is fine, except the only error I get from this is something like Uncaught Error: No such template: <template-name>.

Is there a way to verify which HTML files fail to compile and maybe get some specific errors?

1

There are 1 best solutions below

0
Victor Gorban On

Uncaught Error: No such template:

I think you have no html errors, but you didn't imported your template. Just to remind:

  1. import child templates before parent templates;

  2. import html template file before related .js file

  3. check if you are using correct include syntax and template name.

example:

import './partsTemplates/leftCol.html';
import './partsTemplates/leftCol.js';

import './pageTemplates/dashboard/dashboard.html';
import './pageTemplates/dashboard/dashboard.js'

Here, the template dashboard uses template leftCol. leftCol is a template name (<template name="leftCol">), not a file name.

{{>leftCol}}