Add error handler on template error
sipayRT opened this issue · 5 comments
sipayRT commented
When you have a mistakes in BEMHTML-templates, you'll got error in production mode while tmpl-specs is running:
17:48:26.807 - [rebuild] [desktop.tmpl-specs/header/header.bemhtml-dev.js] bemhtml
17:48:26.809 - [rebuild] [desktop.tmpl-specs/header/header.bemhtml-dev.lang.js] mock-lang-js.js
17:48:26.833 - [failed] [desktop.tmpl-specs/header/header.bemhtml-prod.js] bemhtml
17:48:26.833 - [failed] [desktop.tmpl-specs/header/header.bemhtml-prod.lang.js] mock-lang-js.js
17:48:26.834 - [failed] [desktop.tmpl-specs/header/header.tmpl-spec.js] tmpl-spec
17:48:26.835 - build failed
blond commented
Can you tell me what the mistake was in BEMHTML-templates?
What bin you use for build: enb
or magic
? What version of Node.js
you use?
I suspect that it might be a bug that caused infinite loop and run it in Node.js 0.10
. Such errors do not have a stack trace. Because of this, the console could get consisting of undefined
: https://github.com/enb-make/enb/blob/master/lib/cli/make.js#L23.
sipayRT commented
node: v0.12.2
use magic platform - magic make desktop.tmpl-specs/header
template with mistake:
block('header').elem('logo')(
match(function() { return this.ctx.url; })(
...
) <---[comma should be here]
content()(function() {
...
})
);
Errors:
18:48:45.210 - [rebuild] [desktop.tmpl-specs/header/header.bemhtml-dev.js] bemhtml
18:48:45.212 - [rebuild] [desktop.tmpl-specs/header/header.bemhtml-dev.lang.js] mock-lang-js.js
18:48:45.244 - [failed] [desktop.tmpl-specs/header/header.bemhtml-prod.js] bemhtml
18:48:45.244 - [failed] [desktop.tmpl-specs/header/header.bemhtml-prod.lang.js] mock-lang-js.js
18:48:45.245 - [failed] [desktop.tmpl-specs/header/header.tmpl-spec.js] tmpl-spec
18:48:45.246 - build failed
But I can't reproduce it in bem-components with latest packages
sipayRT commented
can't reproduce