monaco-languageclient: onDidChangeConfiguration is not a function error in both `wrapper-react` and standard use.

I’m receiving a very similar error to #686:

contextKeyService.js:82 Uncaught (in promise) TypeError: this._configurationService.onDidChangeConfiguration is not a function
    at new ConfigAwareContextValuesContainer (contextKeyService.js:82:1)
    at new ContextKeyService (contextKeyService.js:314:1)
    at InstantiationService._createInstance (instantiationService.js:120:1)
    at InstantiationService._createServiceInstance (instantiationService.js:224:1)
    at InstantiationService._createServiceInstanceWithOwner (instantiationService.js:212:1)
    at InstantiationService._createAndCacheServiceInstance (instantiationService.js:203:1)
    at InstantiationService._safeCreateAndCacheServiceInstance (instantiationService.js:161:1)
    at InstantiationService._getOrCreateServiceInstance (instantiationService.js:147:1)
    at Object.get (instantiationService.js:70:1)
    at lifecycle.js:38:1
ConfigAwareContextValuesContainer @ contextKeyService.js:82
ContextKeyService @ contextKeyService.js:314
_createInstance @ instantiationService.js:120
_createServiceInstance @ instantiationService.js:224
_createServiceInstanceWithOwner @ instantiationService.js:212
_createAndCacheServiceInstance @ instantiationService.js:203
_safeCreateAndCacheServiceInstance @ instantiationService.js:161
_getOrCreateServiceInstance @ instantiationService.js:147
get @ instantiationService.js:70
(anonymous) @ lifecycle.js:38
invokeFunction @ instantiationService.js:77
startup @ lifecycle.js:36
await in startup (async)
commitLayoutEffectOnFiber @ react-dom.development.js:23344
commitLayoutMountEffects_complete @ react-dom.development.js:24727
commitLayoutEffects_begin @ react-dom.development.js:24712
commitLayoutEffects @ react-dom.development.js:24651
commitRootImpl @ react-dom.development.js:26862
commitRoot @ react-dom.development.js:26721
finishConcurrentRender @ react-dom.development.js:26020
performConcurrentWorkOnRoot @ react-dom.development.js:25848
workLoop @ scheduler.development.js:266
flushWork @ scheduler.development.js:239
performWorkUntilDeadline @ scheduler.development.js:533

Same error occurs when using the wrapper-react as well as a more general approach:

const wrapper = new MonacoEditorLanguageClientWrapper();
await wrapper.init(getMonacoWrapperConfig());

Turning off HMR and liveReload results in the same error.

It’s possible that this error is related to the bundler I’m using (rsbuild/rspack), but I’ve been able to get regular Monaco Editor working mostly out of the box.

I’ve create a test repro repo. Should just be able to npm install, npm run dev to see the error.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 42

Most upvoted comments

I cant provide help or support, moved onto Ace Editor instead of Monaco and I cant remember what I did. best I can say is check versions of packages, at least package.json and vite config file in main example folder is helpful.

@mxvsh and @caner-cetin I was busy with other things and then away last week. I will provide feedback this week.

Sorry, I missed that.

@mxvsh use 8.0.4 instead of 9.0.3 for all monaco-vscode dependencies. 9.x is not yet supported.

"@codingame/monaco-vscode-keybindings-service-override": "^9.0.3",

monaco editor should be installed as an alias to @codingame/monaco-editor-api instead

Which should be the case because it’s declared in the dependencies of monaco-editor-wrapper

btw @kaisalmen, having monaco-editor in the compatibility table is quite confusing, it’s only for informative purpose and we should probably say that it shouldn’t be installed

I should have done the same with monaco-editor-wrapper