error TS2451: Cannot redeclare block-scoped variable 'MonacoEnvironment'.
jmc420 opened this issue · comments
Hello
I am getting this Typescript error when I import MonacoEditor from '@uiw/react-monacoeditor';
node_modules/@uiw/react-monacoeditor/node_modules/monaco-editor/esm/vs/editor/editor.api.d.ts:12:9 - error TS2451: Cannot redeclare block-scoped variable 'MonacoEnvironment'.
12 let MonacoEnvironment: Environment | undefined;
~~~~~~~~~~~~~~~~~
node_modules/monaco-editor/esm/vs/editor/editor.api.d.ts:12:9
12 let MonacoEnvironment: Environment | undefined;
~~~~~~~~~~~~~~~~~
'MonacoEnvironment' was also declared here.
node_modules/monaco-editor/esm/vs/editor/editor.api.d.ts:12:9 - error TS2451: Cannot redeclare block-scoped variable 'MonacoEnvironment'.
12 let MonacoEnvironment: Environment | undefined;
~~~~~~~~~~~~~~~~~
node_modules/@uiw/react-monacoeditor/node_modules/monaco-editor/esm/vs/editor/editor.api.d.ts:12:9
12 let MonacoEnvironment: Environment | undefined;
~~~~~~~~~~~~~~~~~
'MonacoEnvironment' was also declared here.
[18:22:40] Found 2 errors. Watching for file changes.
it was because I had this import in the code:
import { editor } from 'monaco-editor';
:) I updated the monaco-editor version to ^0.26.0
...