Accessing Monaco from Theia

Up until version 1.24.0 we were adding extra typescript libs to the underlying Monaco editor using the commands such as monaco.languages.typescript.javascriptDefaults.addExtraLib() . This worked well as we were using the moanco editor typescript language via the following commands vsRequire([‘vs/language/typescript/monaco.contribution’]. This is very similar too this post Accessing monaco in Theia - #18 by akosyakov

It looks like the upgrade of the Monaco editor too 0.33 has stopped this working as we now get the error when calling the addExtraLib commands. I suspect Uplift Monaco to VSCode v. 1.65.2 by colin-grant-work · Pull Request #10736 · eclipse-theia/theia · GitHub is the source e.g. “Update our code to use Webpackable modules, rather than Asynch Module code with custom loaders.”

I am just wondering whether it is possible at all too get at the underlying Monaco editor, specifically the typescript language so that we can add extra libs like you can in Monaco?

Example error:
Error: Unexpected usage
at EditorSimpleWorker.loadForeignModule (editor.worker.js:12921:31)
at SimpleWorkerServer._handleMessage (editor.worker.js:9182:65)
at Object.handleMessage (editor.worker.js:9167:51)
at SimpleWorkerProtocol._handleRequestMessage (editor.worker.js:8971:36)
at SimpleWorkerProtocol._handleMessage (editor.worker.js:8940:29)
at SimpleWorkerProtocol.handleMessage (editor.worker.js:8933:14)
at SimpleWorkerServer.onmessage (editor.worker.js:9172:24)
at self.onmessage (editor.worker.js:14267:22)
at errors.ts:26:12