I have to opened 100 instances of Monaco diff editor in my Angular project. If I do this, I get an error in the console about a potential leakage of listeners. Need help on how I can get rid of this error in the console.
Example of Monaco diff editor call:
<div *ngFor="let arr of fakeArray"> <!-- fakeArray = new Array(100) -->
<k-editor></k-editor> <!-- monaco diff editor component -->
</div>
Chrome console:
core.mjs:6531 ERROR Error: [61d] potential listener LEAK detected, having 200 listeners already. MOST frequent listener (1):
Error
at Stacktrace.create (event.js:682:21)
at _a._event [as _onDidChangeLanguages] (event.js:827:46)
at get onDidChange (languageService.js:100:35)
at new TextModel (textModel.js:172:75)
at ModelService._createModelData (modelService.js:253:23)
at ModelService.createModel (modelService.js:297:30)
at doCreateModel (standaloneCodeEditor.js:330:25)
at createTextModel (standaloneCodeEditor.js:324:12)
at Object.createModel (standaloneEditor.js:180:27)
at EditorComponent.monacoInit (editor.component.ts:32:31)
at errors.js:15:27
at timer (zone.js:2402:41)
at _ZoneDelegate.invokeTask (zone.js:403:31)
at core.mjs:14511:55
at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:14511:36)
at _ZoneDelegate.invokeTask (zone.js:402:36)
at Object.onInvokeTask (core.mjs:14824:33)
at _ZoneDelegate.invokeTask (zone.js:402:36)
at Zone.runTask (zone.js:174:47)
at invokeTask (zone.js:484:34)
New contributor
Jan Kowalski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2