Wrong typescript definition in "d.ts" files of "monaco-languageclient" package?

I’m working on an extension for Theia, and at some point I needed to import these classes to use:

import { EditorManager, TextEditor, EditorWidget } from ‘@theia/editor/lib/browser’;

Even though the code compiles and works, I have this error:

error TS2688: Cannot find type definition file for ‘monaco-editor-core/monaco’.

1 ///

in three files:

  • node_modules/monaco-languageclient/lib/monaco-converter.d.ts

  • node_modules/monaco-languageclient/lib/monaco-languages.d.ts

  • node_modules/monaco-languageclient/lib/monaco-workspace.d.ts

And to fix it, I had to modify the first line to:

///

The problem is fixed, but this doesn’t look like the proper approach to fix this, so, where do you think is the real bug? and what should I do about it?

[original thread by Ashraf Cheraa]

Sounds like a bug, please file an issue.

As a work around you can skip validation of d.ts files of your libraries.

in tsconfig skipLibCheck: true

it also will speed up your build and you will see validations in the editor

[Adam Retter]

@anton-kosyakov with the latest dependencies, we are seeing this issue again. Is switching on skipLibCheck: true still the recommended solution?

yes, it should work

[Adam Retter]

@anton-kosyakov okay great thanks :slight_smile: