经过一些重构(我将一个模块一分为二并将 node_modules 更新为最新版本),该应用程序无法启动。我重新生成了翻译文件messages.en.xlf
并将其复制到src/locale
. 这是我在控制台中收到的错误消息。
@角 4.1.1 -> 4.2.6
compiler.es5.js:1689 Uncaught Error: Template parse errors:
Unexpected translation for attribute "label" (id="05ed0716e6b17b25acb25b15efbf6c885bc2ba49") ("
<div class="content slim-scrollbar visible-scrollbar">
[ERROR ->]<card-cmp class="cerulean-blue-label col-sm-12 col-md-12 col-lg-12 clearfix"
i18n-label label="<b"): ng:///PortfoliosModule/PortfolioCompositionCmp.html@6:1
at syntaxError (compiler.es5.js:1689)
at DirectiveNormalizer.normalizeLoadedTemplate (compiler.es5.js:14120)
at compiler.es5.js:14106
at Object.then (compiler.es5.js:1679)
at DirectiveNormalizer.normalizeTemplateOnly (compiler.es5.js:14106)
at DirectiveNormalizer.normalizeTemplate (compiler.es5.js:14088)
at CompileMetadataResolver.loadDirectiveMetadata (compiler.es5.js:15117)
at compiler.es5.js:26692
at Array.forEach (<anonymous>)
at compiler.es5.js:26691
错误的模板代码(以前工作得很好):
<card-cmp class="cerulean-blue-label col-sm-12 col-md-12 col-lg-12 clearfix"
i18n-label label="<b>Composition</b>"
[hasCollapse]="false">
//...
</card-cmp>
编辑:
看起来将库降级回以前的设置可以防止错误发生。