Monaco-languageclient build error

Hi,
When i build theia(including my-extension) , it appears monaco-languageclient build error.

build error like below

ERROR in …/node_modules/monaco-languageclient/lib/connection.js
Module not found: Error: Can’t resolve ‘vscode-languageserver-protocol/lib/main’ in ‘/home/Desktop/MY_THIEA/node_modules/monaco-languageclient/lib’
@ …/node_modules/monaco-languageclient/lib/connection.js 27:13-63
@ …/node_modules/monaco-languageclient/lib/index.js
@ …/node_modules/@theia/languages/lib/browser/language-client-services.js
@ …/node_modules/@theia/languages/lib/browser/languages-frontend-module.js
@ ./src-gen/frontend/index.js

ERROR in …/node_modules/monaco-languageclient/lib/services.js
Module not found: Error: Can’t resolve ‘vscode-languageserver-protocol/lib/main’ in ‘/home/Desktop/MY_THIEA/node_modules/monaco-languageclient/lib’
@ …/node_modules/monaco-languageclient/lib/services.js 10:13-63 16:9-59
@ …/node_modules/monaco-languageclient/lib/index.js
@ …/node_modules/@theia/languages/lib/browser/language-client-services.js
@ …/node_modules/@theia/languages/lib/browser/languages-frontend-module.js
@ ./src-gen/frontend/index.js

ERROR in …/node_modules/monaco-languageclient/lib/connection.js
Module not found: Error: Can’t resolve ‘vscode-languageserver-protocol/lib/utils/is’ in ‘/home/Desktop/MY_THIEA/node_modules/monaco-languageclient/lib’
@ …/node_modules/monaco-languageclient/lib/connection.js 28:9-63
@ …/node_modules/monaco-languageclient/lib/index.js
@ …/node_modules/@theia/languages/lib/browser/language-client-services.js
@ …/node_modules/@theia/languages/lib/browser/languages-frontend-module.js
@ ./src-gen/frontend/index.js

ERROR in …/node_modules/monaco-languageclient/lib/monaco-converter.js
Module not found: Error: Can’t resolve ‘vscode-languageserver-protocol/lib/utils/is’ in ‘/home/Desktop/MY_THIEA/node_modules/monaco-languageclient/lib’
@ …/node_modules/monaco-languageclient/lib/monaco-converter.js 48:9-63
@ …/node_modules/monaco-languageclient/lib/index.js
@ …/node_modules/@theia/languages/lib/browser/language-client-services.js
@ …/node_modules/@theia/languages/lib/browser/languages-frontend-module.js
@ ./src-gen/frontend/index.js

And browser-app/package.json is below

{
“private”: true,
“name”: “MY_THEIA”,
“version”: “0.5.0”,
“theia”: {
“frontend”: {
“config”: {
“applicationName”: “MY_THEIA”,
“defaultTheme”: “light”
}
}
},
“dependencies”: {
@theia/core”: “^0.9.0”,
@theia/filesystem”: “^0.9.0”,
@theia/workspace”: “^0.9.0”,
@theia/preferences”: “^0.9.0”,
@theia/navigator”: “^0.9.0”,
@theia/process”: “^0.9.0”,
@theia/terminal”: “^0.9.0”,
@theia/editor”: “^0.9.0”,
@theia/languages”: “^0.9.0”,
@theia/markers”: “^0.9.0”,
@theia/monaco”: “^0.9.0”,
@theia/textmate-grammars”: “^0.9.0”,
@theia/typescript”: “^0.9.0”,
@theia/messages”: “^0.9.0”,
@my/my-extension”: “0.7.2”
},
“devDependencies”: {
@theia/cli”: “^0.9.0”
},
“scripts”: {
“prepare”: “theia build --mode development”,
“start”: “theia start”,
“watch”: “theia build --watch --mode development”
}
}

and my-extension package.json is below

{
“name”: “@my/my-extension”,
“description”: “my editor”,
“version”: “0.7.2”,
“files”: [
“lib”,
“data”,
“build”
],
“devDependencies”: {
“rimraf”: “latest”,
“typescript”: “latest”
},
“scripts”: {
“prepare”: “yarn run clean && yarn run build”,
“clean”: “rimraf lib”,
“build”: “tsc”,
“watch”: “tsc -w”
},
“theiaExtensions”: [
{
“frontend”: “lib/browser/my-frontend-module”,
“backend”: “lib/node/my-backend-module”
}
],
“license”: “SEE LICENSE IN LICENSE”
}

What’s the problem with me ?
Any comments will be help me.
Thanks.

@kay thank you for the discussion, please add the following yarn resolution to your application’s package.json which was necessary for older extension versions:

  "resolutions": {
    "vscode-jsonrpc": "5.0.1",
    "vscode-languageserver-protocol": "3.15.3"
  }

I confirmed that it works, albeit without your custom extension :slight_smile:

1 Like