eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.05k stars 2.5k forks source link

Tabnine vscode extension installation fails on Theia #10880

Closed fyudanov closed 1 year ago

fyudanov commented 2 years ago

Attempt to install Tabnine plugin fails on Theia (browser version) with error: Class extends value undefined is not a constructor or null

Reproducible on Theia versions 1.19-1.23

Also checked the configuration from https://github.com/eclipse-theia/theia/issues/10447. Fails the same way on my side.

Screen Shot 2022-03-14 at 23 03 58

  1. In Theia open Extensions tab
  2. Input "tabnine" as search line
  3. Install Tabnine extension from search results
{
  "private": true,
  "name": "theia-ide",
  "description": "Theia IDE",
  "productName": "Theia IDE",
  "version": "1.0.0",
  "engines": {
    "yarn": "1.0.x || >=1.2.1",
    "node": ">=12.14.1"
  },
  "theia": {
    "frontend": {
      "config": {
        "applicationName": "Theia IDE"
      }
    },
    "backend": {
      "config": {
        "startupTimeout": -1,
        "resolveSystemPlugins": false
      }
    }
  },
  "dependencies": {
    "@theia/bulk-edit": "1.23.0",
    "@theia/callhierarchy": "1.23.0",
    "@theia/cli": "1.23.0",
    "@theia/console": "1.23.0",
    "@theia/core": "1.23.0",
    "@theia/debug": "1.23.0",
    "@theia/editor": "1.23.0",
    "@theia/editor-preview": "1.23.0",
    "@theia/file-search": "1.23.0",
    "@theia/filesystem": "1.23.0",
    "@theia/getting-started": "1.23.0",
    "@theia/keymaps": "1.23.0",
    "@theia/markers": "1.23.0",
    "@theia/messages": "1.23.0",
    "@theia/metrics": "1.23.0",
    "@theia/mini-browser": "1.23.0",
    "@theia/monaco": "1.23.0",
    "@theia/navigator": "1.23.0",
    "@theia/outline-view": "1.23.0",
    "@theia/output": "1.23.0",
    "@theia/plugin-dev": "1.23.0",
    "@theia/plugin-ext": "1.23.0",
    "@theia/plugin-ext-vscode": "1.23.0",
    "@theia/preferences": "1.23.0",
    "@theia/process": "1.23.0",
    "@theia/property-view": "1.23.0",
    "@theia/scm": "1.23.0",
    "@theia/scm-extra": "1.23.0",
    "@theia/search-in-workspace": "1.23.0",
    "@theia/task": "1.23.0",
    "@theia/terminal": "1.23.0",
    "@theia/timeline": "1.23.0",
    "@theia/typehierarchy": "1.23.0",
    "@theia/userstorage": "1.23.0",
    "@theia/variable-resolver": "1.23.0",
    "@theia/vsx-registry": "1.23.0",
    "@theia/workspace": "1.23.0",
    "fs-extra": "^9.0.1"
  },
  "devDependencies": {
    "@types/js-yaml": "^3.12.0",
    "@types/yargs": "^17.0.2",
    "js-yaml": "^3.12.0",
    "rimraf": "^2.7.1",
    "ts-node": "^10.0.0",
    "yargs": "^17.0.1"
  },
  "scripts": {
    "prepare": "yarn build && yarn download:plugins",
    "clean": "theia clean && rimraf node_modules",
    "clean:dist": "rimraf dist",
    "build": "theia build",
    "watch": "concurrently -n compile,bundle \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"",
    "start": "theia start --plugins=local-dir:plugins --hostname=0.0.0.0",
    "start:debug": "yarn start --log-level=debug",
    "download:plugins": "theia download:plugins"
  },
  "theiaPluginsDir": "plugins",
  "theiaPlugins": {
  },
  "theiaPluginsExcludeIds": [
  ]
}

vince-fugnitto commented 2 years ago

@fyudanov duplicate of https://github.com/eclipse-theia/theia/issues/10447?

msujew commented 2 years ago

@vince-fugnitto I don't think so, the culprit seems to be this:

root ERROR [hosted-plugin: 3724] Activating extension 'tabnine-vscode' failed: TypeError: Class extends value undefined is not a constructor or null
    at Object.4234 (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:78028)
    at n (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:165032)
    at Object.1465 (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:86680)
    at n (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:165032)
    at Object.4624 (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:69658)
    at n (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:165032)
    at /home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:165511
    at /home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:167668
    at Object.<anonymous> (/home/gitpod/.theia/extensions/TabNine.tabnine-vscode-3.5.32.vsix/extension/out/extension.js:17:167689)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)

The extension creashes completely during its startup, since it can't resolve the extends InlineCompletionItem. Older versions of Tabnine (tested with 3.5.21) work correctly.

msujew commented 2 years ago

@vince-fugnitto Digging deeper, it seems like InlineCompletionItem is currently proposed API, which doesn't make a lot of sense, given that their pinned version of VSCode is still 1.50...

vince-fugnitto commented 2 years ago

@msujew it seems to be a proposed api that was recently introduced, I'd suggest that an older version of tabnine should be used instead.

Edit: you beat me to it ;)

fyudanov commented 2 years ago

So it would be a simple workaround to install on older version of Tabnine )

Probably a newbie question from my side, but does Theia allows this from UI (like e.g. VScode does https://code.visualstudio.com/updates/v1_30#_install-previous-versions)?

vince-fugnitto commented 2 years ago

@fyudanov it is currently in-progress https://github.com/eclipse-theia/theia/pull/9330.

fyudanov commented 2 years ago

@fyudanov it is currently in-progress #9330.

Ok. Thanks for a quick help!

vince-fugnitto commented 1 year ago

I believe the extension should now work, and the ability to install different versions of a plugin exists.