Skip to content

Commit 5cdb029

Browse files
li-xin-yipqn
andauthored
Fix the Monaco undefined error on some websites (#50)
* fix _codeium_monaco undefined error * Update script.ts --------- Co-authored-by: Prem Nair <prem.q.nair@gmail.com>
1 parent 85072bf commit 5cdb029

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/script.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ const addMonacoInject = () =>
7474
break;
7575
}
7676
}
77-
77+
this._codeium_monaco = _monaco;
7878
const completionProvider = new MonacoCompletionProvider(extensionId, injectMonaco);
79-
if (!_monaco.languages.registerInlineCompletionsProvider) {
79+
if (!_monaco?.languages?.registerInlineCompletionsProvider) {
8080
return;
8181
}
8282
setTimeout(() => {
@@ -98,7 +98,6 @@ const addMonacoInject = () =>
9898
});
9999
console.log('Activated Codeium: Monaco');
100100
});
101-
this._codeium_monaco = _monaco;
102101
},
103102
},
104103
});

0 commit comments

Comments
 (0)