File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -64,15 +64,16 @@ const GITHUB_DARK_EDITOR_COLORS: monaco.editor.IColors = {
6464
6565export const configureMonaco = ( ) => {
6666 // Route YAML language to monaco-yaml worker, everything else to the default editor worker
67- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68- ( self as any ) . MonacoEnvironment = {
69- getWorker : ( _ : string , label : string ) => {
70- if ( label === 'yaml' ) {
71- return new YamlWorker ( ) ;
72- }
73- return new EditorWorker ( ) ;
74- } ,
75- } ;
67+ if ( typeof window !== 'undefined' ) {
68+ window . MonacoEnvironment = {
69+ getWorker : ( _moduleId : string , label : string ) : Worker => {
70+ if ( label === 'yaml' ) {
71+ return new YamlWorker ( ) ;
72+ }
73+ return new EditorWorker ( ) ;
74+ } ,
75+ } ;
76+ }
7677
7778 monaco . editor . defineTheme ( GITHUB_LIGHT_DEFAULT , {
7879 base : 'vs' ,
You can’t perform that action at this time.
0 commit comments