Closed jmc420 closed 3 years ago
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'.
node_modules/@uiw/react-monacoeditor/node_modules/monaco-editor/esm/vs/editor/editor.api.d.ts:12:9 12 let MonacoEnvironment: Environment | undefined;
[18:22:40] Found 2 errors. Watching for file changes.
Don't know what the problem is without an example? @jmc420
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
...
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 - error TS2451: Cannot redeclare block-scoped variable 'MonacoEnvironment'.
12 let MonacoEnvironment: Environment | undefined;
[18:22:40] Found 2 errors. Watching for file changes.