"let-" is only supported on ng-template elements

Just search all

  1. <template and replace with <ng-template

  2. </template> and replace with </ng-template>


I have encountered this error when upgraded from Angular 4.x.x to 5.x.x. Original code was:

<template let-item>

</template>

This worked fine in Angular 4, but failed in 5. Simply using ng-template worked correctly (no packages installation was required, no cache clean required):

<ng-template let-item>

</ng-template>

there are no <template> tags in v2+, please do clean install, and check that you have ngx-bootstrap v2+ check package lock if present


ngx-bootstrap 1.x.x using <template> which has been deprecated in angular 5.x.x. so you have to upgrade to ngx-bootstrap 2.X.X

Do following to upgrade

npm uninstall --save ngx-bootstrap
npm cache clean -f
npm install --save ngx-bootstrap