Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typescript][built-in] an error occurred while loading plugin #7858

Closed
502647092 opened this issue May 21, 2020 · 13 comments
Closed

[typescript][built-in] an error occurred while loading plugin #7858

502647092 opened this issue May 21, 2020 · 13 comments
Labels
builtins Issues related to VS Code builtin extensions

Comments

@502647092
Copy link
Contributor

502647092 commented May 21, 2020

Bug Description:

theia_1  | root INFO [hosted-plugin: 256] PLUGIN_HOST(256): PluginManagerExtImpl/loadPlugin(/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension)
theia_1  | root ERROR [hosted-plugin: 256] Error on activation of typescript-language-features Error: Could not find bundled tsserver.js
theia_1  |     at t.TypeScriptVersionProvider.get bundledVersion [as bundledVersion] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:50759)
theia_1  |     at t.TypeScriptVersionProvider.get defaultVersion [as defaultVersion] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:50055)
theia_1  |     at new t.TypeScriptVersionManager (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:46159)
theia_1  |     at new e (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:194790)
theia_1  |     at new t.default (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:106097)
theia_1  |     at r.f.lazy [as _getValue] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:98900)
theia_1  |     at r.get value [as value] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:78230)
theia_1  |     at o (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:99690)
theia_1  |     at Array.some (<anonymous>)
theia_1  |     at /home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:99788
theia_1  | root ERROR Failed to fetch children for 'npm' TypeError: Cannot read property 'serviceClient' of undefined
theia_1  |     at e.subscriptions.push.r.tasks.registerTaskProvider.b.default._.map.e (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:1:99263)
theia_1  |     at r [as _getValue] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:78316)
theia_1  |     at r.get value [as value] (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:78230)
theia_1  |     at d.getActiveTypeScriptFile (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:86394)
theia_1  |     at d.getTsConfigForActiveFile (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:85154)
theia_1  |     at d.getAllTsConfigs (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:84770)
theia_1  |     at d.provideTasks (/home/theia/plugins/vscode-builtin-typescript-language-features/package/dist/extension.js:53:84177)
theia_1  |     at TaskProviderAdapter.provideTasks (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/tasks/task-provider.js:36:46)
theia_1  |     at TasksExtImpl.$provideTasks (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/tasks/tasks.js:208:28)
theia_1  |     at RPCProtocolImpl.doInvokeHandler (/home/theia/node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js:270:23)
  • i try install 1.44.2 ts plugin still have error but it can run
theia_1  | root ERROR [hosted-plugin: 343] With stack trace: TypeError: i.workspace.onDidRenameFiles is not a function
theia_1  |     at new e (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:53:56306)
theia_1  |     at s.u.VersionDependentRegistration [as _doRegister] (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:53:59522)
theia_1  |     at s.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:13751)
theia_1  |     at t.VersionDependentRegistration.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14220)
theia_1  |     at new t.VersionDependentRegistration (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14019)
theia_1  |     at Object.t.register (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:53:59468)
theia_1  |     at Promise.resolve.then.then.e (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:104708)
theia_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
theia_1  | root ERROR [hosted-plugin: 343] Promise rejection not handled in one second: TypeError: r.SemanticTokensLegend is not a constructor , reason: TypeError: r.SemanticTokensLegend is not a constructor
theia_1  | root ERROR [hosted-plugin: 343] With stack trace: TypeError: r.SemanticTokensLegend is not a constructor
theia_1  |     at a.getLegend (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182974)
theia_1  |     at s.i.VersionDependentRegistration [as _doRegister] (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182814)
theia_1  |     at s.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:13751)
theia_1  |     at t.VersionDependentRegistration.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14220)
theia_1  |     at new t.VersionDependentRegistration (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14019)
theia_1  |     at Object.t.register (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182671)
theia_1  |     at Promise.all.Promise.resolve.then.then.t (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:130466)
theia_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
theia_1  | Promise rejection not handled in one second: TypeError: r.SemanticTokensLegend is not a constructor , reason: TypeError: r.SemanticTokensLegend is not a constructor
theia_1  | root ERROR [hosted-plugin: 343] With stack trace: TypeError: r.SemanticTokensLegend is not a constructor
theia_1  |     at a.getLegend (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182974)
theia_1  |     at s.i.VersionDependentRegistration [as _doRegister] (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182814)
theia_1  |     at s.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:13751)
theia_1  |     at t.VersionDependentRegistration.update (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14220)
theia_1  |     at new t.VersionDependentRegistration (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:14019)
theia_1  |     at Object.t.register (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:182671)
theia_1  |     at Promise.all.Promise.resolve.then.then.t (/home/theia/plugins/vscode-builtin-typescript-language-features/extension/dist/extension.js:1:130466)
theia_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)

Steps to Reproduce:

  1. install latest or 1.44.2 typescript-language-features built-in plugin

Additional Information

  • Operating System:
    • Server: CentOS7
    • Brower: Windows10
  • Theia Version: 1.2.0-next.f97ec33e
@502647092 502647092 changed the title [typescript][built-in][hosted-plugin: 256] Error on activation of typescript-language-features Error: Could not find bundled tsserver.js [typescript][built-in] an error occurred while loading plugin May 21, 2020
@vince-fugnitto vince-fugnitto added the builtins Issues related to VS Code builtin extensions label May 21, 2020
@kittaakos
Copy link
Contributor

kittaakos commented May 21, 2020

Related: #7171, #7697

  • TypeError: r.SemanticTokensLegend is not a constructor
  • TypeError: i.workspace.onDidRenameFiles is not a function

@502647092
Copy link
Contributor Author

Error on activation of typescript-language-features Error: Could not find bundled tsserver.js
maybe builtin plugin use bundled tsserver.js
but not in theia

@akosyakov
Copy link
Member

@marcdumais-work Could it be that typescript is not packaged anymore as a part of built-in vscode extension?

@kittaakos
Copy link
Contributor

kittaakos commented May 25, 2020

is not packaged

It is. I have verified with https://open-vsx.org/api/vscode/typescript-language-features/1.44.2/file/vscode.typescript-language-features-1.44.2.vsix.

ls -al plugins/vscode-builtin-typescript-language-features/extension/deps/typescript/bin
total 16
drwxr-xr-x   4 akos.kitta  staff  128 May 19 09:27 .
drwxr-xr-x  12 akos.kitta  staff  384 May 19 09:27 ..
-rw-r--r--   1 akos.kitta  staff   45 May 19 09:27 tsc
-rw-r--r--   1 akos.kitta  staff   50 May 19 09:27 tsserver
akos.kitta@Akoss-MacBook-Pro theia % 
ls -al plugins/vscode-builtin-typescript-language-features/extension/deps/typescript/lib | grep tsserver
-rw-r--r--   1 akos.kitta  staff  8667823 May 19 09:27 tsserver.js

@marcdumais-work
Copy link
Contributor

Ok, I'll have a look.

@marcdumais-work
Copy link
Contributor

Hi,

A sanity check: using this repo's example application (builtins v1.44.2) I do not see the tsserver error:

Error on activation of typescript-language-features Error: Could not find bundled tsserver.js

And as far as I can tell, Typescript language support seems to work. What am I missing?

@vince-fugnitto
Copy link
Member

I also verified the behavior and did not notice any errors related to missing tsserver.
I verified that language-features work correctly (ex: 'go to definition'), and that executing the command TypeScript: Restart TS Server works as well (the application correctly falls on it's feet).

@marcdumais-work
Copy link
Contributor

@502647092 Which version of the built-in extensions did you first use, that had the issue with tsserver?

@502647092
Copy link
Contributor Author

@marcdumais-work auto build builtin plugin at theia-ide/vscode-builtin-extensions
Error on activation of typescript-language-features Error: Could not find bundled tsserver.js

@marcdumais-work
Copy link
Contributor

@marcdumais-work auto build builtin plugin at theia-ide/vscode-builtin-extensions
Error on activation of typescript-language-features Error: Could not find bundled tsserver.js

From npm? Indeed there is a little patch missing in that version of the typescript-language-features built-in, that we add to the vsix version we publish on open-vsx.org, related to the bundled typescript. TL;DR: in vscode the build-ins are not packaged, and typescript resides in relative folder ../node_modules which does not exist in a packaged vsix extension.

I think we may be soon stop publishing on npm, since we're about to be able to automatically publish a preview/next version of each built-in nightly based on latest vscode master: eclipse-theia/vscode-builtin-extensions#30

@marcdumais-work
Copy link
Contributor

@502647092 So you can add this one extension at least in your app's package.json:
https://github.com/eclipse-theia/theia/blob/master/package.json#L140

@marcdumais-work
Copy link
Contributor

marcdumais-work commented May 26, 2020

auto build builtin plugin

Sorry - missed that part. Then you're probably using the npm packaging script, with the same result as if you'd pull from npm.

Do it like this instead, after checking-out the version you want of the vscode submodule: https://github.com/theia-ide/vscode-builtin-extensions/blob/master/.gitpod.yml#L12-L13

You can substitute yarn package-vsix:next for yarn package-vsix:latest if you want to release a solid revision.

@502647092
Copy link
Contributor Author

@marcdumais-work 1.44.2 it's ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins Issues related to VS Code builtin extensions
Projects
None yet
Development

No branches or pull requests

5 participants