janl / mustache.js

Minimal templating with {{mustaches}} in JavaScript

Home Page:https://mustache.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Angular Error]: TemplateSpans circularly references itself

soscler opened this issue · comments

How to solve this error that I get when I use mustache in angular
ERROR in node_modules/@types/mustache/index.d.ts(362,6): error TS2456: Type alias 'TemplateSpans' circularly references itself.

I have the following versions:

Angular: 8.2.14
Mustache: 4.0.1
@types/mustache: 4.0.1
typescript: 3.5.3

One work arround is to use @ts-ignore, but this doesn't solve the issue, instead it hides it.
Another way is to remove the circular dependency inside the index.ts file but, I ignore what other bug I'll introduce by doing so.

Hi @soscler!

I seem to remember TypeScript adding support for circular references at some point, and the @types/mustache.js declarations has this hint:

// Minimum TypeScript Version: 3.7

Try bumping your TypeScript version?

Thank you, upgrading to typescript 3.7.2 solved the issue.

Yeay, thanks for the update 👍