TypeFox / monaco-languageclient

Repo hosts npm packages for monaco-languageclient, vscode-ws-jsonrpc, monaco-editor-wrapper, @typefox/monaco-editor-react and monaco-languageclient-examples
https://www.npmjs.com/package/monaco-languageclient
MIT License
1.04k stars 178 forks source link

onDidChangeConfiguration is not a function error in both `wrapper-react` and standard use. #709

Open brochington opened 1 month ago

brochington commented 1 month ago

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.

CGNonofr commented 1 month ago

@kaisalmen As always, the issue is multiple package version installed

monaco-editor-wrapper@5.3.1 uses monaco-vscode-api@6.0.3 and you're using @codingame/monaco-vscode-python-default-extension@7.0.5, instead of the 6.0.3

kaisalmen commented 1 month ago

@CGNonofr there must/should occur peerDependeny warnings. I have to check that independently

wangyanci commented 1 month ago

image similar error

image
CGNonofr commented 1 month ago

Did you check for multiple package version installed?