Can't save file
monaco-editor-model.js:288 Uncaught (in promise) TypeError: Cannot read property 'Manual' of undefined
at e.save (monaco-editor-model.js:288)
at Object.<anonymous> (saveable.ts:69)
at bundle.js:14
at Object.next (bundle.js:14)
at bundle.js:14
at new Promise (<anonymous>)
at o (bundle.js:14)
at Object.e.save (bundle.js:14)
at n.<anonymous> (application-shell.ts:1499)
at bundle.js:1
OS and Theia version:
Diagnostics:
5 days ago the image is ok
It seems that Microsoft team hast moved TextDocumentSaveReason from vscode-languageserver-types into vscode-languageserver-protocol in latest version 3.15.0-next.6.
It's probably related to https://github.com/TypeFox/monaco-languageclient/issues/184
A work around is to use yarn resolutions to lock vscode-* versions as in yarn.lock in the theia repo.
cc @lmcbout might be why you were getting errors with your fresh builds.
@marechal-p This is exactly the error I am getting with the electron application
Following @akosyakov suggestion by adjusting package.json , I added the following for the applications and the "Save" option is working (Electron and Browser). I don't know If we need all the vscode-* version, but it works fine:
"resolutions": {
"vscode-debugprotocol": "1.37.0",
"vscode-json-languageserver": "1.2.2",
"vscode-json-languageservice": "3.4.3",
"vscode-jsonrpc": "4.1.0-next.3",
"vscode-languageclient": "5.3.0-next.9",
"vscode-languageserver": "5.3.0-next.10",
"vscode-languageserver-protocol": "3.15.0-next.9",
"vscode-languageserver-types": "3.15.0-next.5",
"vscode-nls": "4.1.1",
"vscode-ripgrep": "1.5.7",
"vscode-textbuffer": "1.0.0",
"vscode-textmate": "4.3.0",
"vscode-uri": "1.0.8",
"vscode-ws-jsonrpc": "0.1.1"
},
It seems we only need the resolution for the following 2 applications in package.json file:
"resolutions": {
"vscode-languageserver-protocol": "3.15.0-next.9",
"vscode-languageserver-types": "3.15.0-next.5"
}
An update happens 2 days ago with the faulty application and the "Save" options doesn't work with the "next" version which point to one release newer than the proposed "resolution" version.
Tested on electron and the browser, work fine
I think https://github.com/eclipse-theia/theia/pull/6255 fixes this issue, because I pull all the latest packages according to our version ranges (just like for new applications). And I am able to save in the example applications.
Does someone know how to verify that?
To test, I removed the yarn.lock and recompiled, I verified that the required version for "vscode-languageserver-protocol" and "vscode-languageserver-types" were newer than the version we pinned in the resolutions. It pickups the latest for each application. It seems to work fine. The auto-save and manual save are working. So I guess the fix for #6255 also fix this issue.
@marechal-p the issue still persist in next despite your changes.
Did you mean that you fixed the issue only for the main repository or globally for extenders and apps?
It should have fixed it for extenders too if master worked after pulling all the latest deps.
Mostly, some issue happened because of refactorings done on the vscode-languageserver-types and vscode-languageserver-protocol. MS people moved types around, so our code was requesting classes from the wrong places. I assumed by rewiring things correctly it would fix it downstream as well.
People should also stop using the resolutions as defined in the following comment: https://github.com/eclipse-theia/theia/issues/6500#issuecomment-550472662
Because our code looks in the updated places, if you force resolutions to the old packages, then you will have the same issue again, but the other way around this time.
I believe the issue is fixed, please re-open if its not the case.
Most helpful comment
It seems we only need the resolution for the following 2 applications in package.json file:
An update happens 2 days ago with the faulty application and the "Save" options doesn't work with the "next" version which point to one release newer than the proposed "resolution" version.
Tested on electron and the browser, work fine