bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

Verbose output for compilation errors #19

Closed jifeon closed 8 years ago

jifeon commented 10 years ago

I have a bemhtml file with following content:

block('')

When I build my project in the production mode I get an error:

AssertionError: "Identifier" == "CallExpression"
    at dive (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/compiler.js:317:12)
    at Compiler.flatten (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/compiler.js:355:10)
    at Compiler.pretranslate (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/compiler.js:91:22)
    at Compiler.translate (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/compiler.js:105:14)
    at Compiler.generate (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/compiler.js:692:14)
    at Object.generate (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/node_modules/bem-xjst/lib/bemhtml/api.js:16:40)
    at exports.techMixin.getCompiledResult (/home/jifeon/projects/bnsf-adwiki/libs/bem-core/.bem/techs/bemhtml.js:46:24)
    at _fulfilled (/home/jifeon/projects/bnsf-adwiki/node_modules/bem/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/home/jifeon/projects/bnsf-adwiki/node_modules/bem/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/home/jifeon/projects/bnsf-adwiki/node_modules/bem/node_modules/q/q.js:760:13)

It's really impossible to guess what the file I should fix for successful build. Could you provide more verbose output with the bemhtml file name?

tadatuta commented 10 years ago

@indutny @veged it'd be great to implement something like https://github.com/bem/bem-bl/commit/a8a016bc22d6eb4eeb7de53889a2c75a2b6e3d59 on bem-xjst level as now we have at least two different build tools.

veged commented 10 years ago

the problem is that we concat all *.bemhtml files before pass it to bem-xjst — so from bem-xjst point of view there is only one file (my-bundle.bemhtml)

but if we print source line with error plus couple of lines before and after it should help in this particular case (because of borschik comments about concatenated sources) — @indutny can we?

apsavin commented 9 years ago

@indutny can we?)

arikon commented 8 years ago

Closing in favor of #49