Theia cannot start frontend plugins any more. Despite frontend plugins are displayed in Plugins panel they aren't loaded correctly, so there is no contributions from them.
THEIA_PLUGINS or HOSTED_PLUGIN environment variable)OS and Theia version:
Fedora 31, Theia 7a77a3b36416fca1319e66048feb1a1d8264401c (master at the moment of this issue creation).
Diagnostics:
Theia log
root INFO Theia app listening on http://0.0.0.0:3000.
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /home/mmorhun/projects/theia/plugins/2222
root INFO Deploying frontend plugin "[email protected]" from "dist/2222-frontend.js"
root INFO Detected keyboard layout from browser API: US (PC)
root WARN Collided keybinding is ignored; {"command":"editor.action.toggleTabFocusMode","keybinding":"ctrl+m"} collided with {"command":"core.toggleMaximized","keybinding":"ctrl+m"}
root WARN Could not register keybinding:
{"command":"editor.action.toggleTabFocusMode","keybinding":"ctrl+m"}
Error: "ctrl+m" is in collision with something else [scope:0]
root WARN Collided keybinding is ignored; {"command":"passthrough","keybinding":"ctrl+k","context":"terminalActive"} collided with {"command":"terminal:clear","keybinding":"ctrlcmd+k","context":"terminalActive"}
root WARN Could not register keybinding:
{"command":"passthrough","keybinding":"ctrl+k","context":"terminalActive"}
Error: "ctrl+k" is in collision with something else [scope:0]
root INFO Using Git [2.23.0] from the PATH. (/usr/bin/git)
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/.theia
root WARN EditorNavigationContribution.onStart is slow, took: 558.870000000752 ms
root INFO Changed application state from 'init' to 'started_contributions'.
root INFO Changed application state from 'started_contributions' to 'attached_shell'.
root INFO >>> Restoring the layout state...
root INFO Checking whether '--no-optional-locks' can be used with the current Git executable. Minimum required version is '2.15.0'.
root INFO '--no-optional-locks' is a valid Git option for the current Git version: '2.23.0'.
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Sync of 1 plugin took: 171.91000000093482 ms
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples/.theia/tasks.json
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples/.theia/launch.json
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples/.theia/settings.json
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples/samples/key-value-storage/src/key-value-storage-frontend.ts
root INFO [nsfw-watcher: 84352] Started watching: /home/mmorhun/projects/che-theia-samples
root INFO [hosted-plugin: 84391] PLUGIN_HOST(84391) starting instance
root INFO <<< The layout has been successfully restored.
root INFO Changed application state from 'attached_shell' to 'initialized_layout'.
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b][theia.2222]: Loaded contributions.
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Load contributions of 1 plugin took: 0.5850000015925616 ms
root ERROR Failed to start plugins for 'frontend' host Error: not supported
at Object.get rawModel [as rawModel] (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:12876:35)
at http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38578:45
at Object.init (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:12880:35)
at PluginManagerExtImpl.<anonymous> (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:39004:60)
at step (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38875:23)
at Object.next (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38856:53)
at http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38850:71
at new Promise (<anonymous>)
at ../../packages/plugin-ext/lib/plugin/plugin-manager.js.__awaiter (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38846:12)
at PluginManagerExtImpl.../../packages/plugin-ext/lib/plugin/plugin-manager.js.PluginManagerExtImpl.$start (http://localhost:3000/worker-ext.7e4110dacb549bd37efd.js:38999:16)
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Start of 0 plugins took: 831.0050000000047 ms
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Sync of 0 plugins took: 57.655000000522705 ms
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Load contributions of 0 plugins took: 0.019999999494757503 ms
root INFO Changed application state from 'initialized_layout' to 'ready'.
root INFO [bd20cf06-6b45-49a2-8fc0-47027ab3b76b] Start of 0 plugins took: 58.98499999966589 ms
Access to metadata was removed for frontend plugins because of performance reasons.
From CHANGELOG.md:
- PluginMetadata does not have anymore raw package.json model to avoid sending excessive data to the frontend
- theia.Plugin.packageJSON throws an unsupported error for frontend plugins as a consequence. Please convert to a backend plugin if you need access to it
Someone could look though to fetch these metadata lazily after we figure out that the plugin should be loaded in the web worker on the frontend, in such way who uses VS Code extensions won't be affected by slow startup.
@akosyakov Can you detail what this implies for the hello world frontend plugin itself? What has to be done so that it can be loaded safely?
I faced with the same issue today when tried to use my old test plugin.
I tried to generate a new plugin according to https://theia-ide.org/docs/authoring_plugins and got the same error.
Maybe it makes sense to edit docs or do not generate frontend hello world plugin.
Even using another generator which is not the hello-world one still got the same error Failed to start plugins for 'frontend' host Error: not supported. Also using backend type plugin, not the same error but a similar one.
Also on my side. In hosted mode, the frontend plugin is displayed in Plugins View panel but it is not loaded correctly, so there is no contributions from it.
The difference is that I'm not able to find any error messages related inside logs.
Edit 1:
Now i obtain Failed to start plugins for 'frontend' host Error: not supported after adding contributes and viewsContainers in plugin _package.json_
So, my question is: are there some docs to follow in order to create a working front-end plugin ?
Edit 2:
Also by accessing plugins from theia.plugins.all (from a second plugin) I don't see it even if it is showed in the plugins view panel
@akosyakov Can you detail what this implies for the
hello world frontend pluginitself? What has to be done so that it can be loaded safely?
@akosyakov Could you provide more information, please? Plugins created by generator are still not working.
@akosyakov I'm facing exactly the same issue with an helloworld frontend plugin and I can't find any solution in the code. I can create a functionnal back end plugin but not a frontend one.
Would anybody have a simple example of a frontend plugin ?
Just to make this clear: front end plugins cannot be loaded _at all_ until we fix this issue: the pluginAPIFactory in plugin-context.ts throws an error if "rawModel" is not available.
I've got a fix: stand by for PR.