-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Bug Description:
In packaged Theia Electron based applications the default about dialog does not show the list of contained Theia extensions.
Note that the Theia IDE uses a customized about dialog and therefore the problem is not visually apparent.
Steps to Reproduce:
- Build the Theia Browser example app
- Delete the
node_modulesdirectory (it's not required as the backend is bundled by default) - Run the example app (
node examples/browser/lib/backend/main.js) - Open the about dialog
You can also reproduce this with the Theia Electron example app, however you need to keep all Electron related dependencies in node_modules as they are not bundled with Theia.
The issue typically occurs in packaged Theia Electron based applications as publishers no longer package node_modules since the backend bundling was introduced.
In development environments and in Docker images the node_modules are usually present, thereby the error does not manifest then. However in theory the node_modules could also not be present, as shown in the reproduction steps.
Analysis
- The dialog requests the information from the
AppServer - The
AppServerreceives the information from the injectedApplicationPackage - The
ApplicationPackageis created by thebackend-application-module - The
ApplicationPackageuses theExtensionPackageCollector - The
ExtensionPackageCollectorwalks through the fileystem and tries to collectpackage.jsonfiles
As the extension information comes through the collector, it fails if the packages are not available, i.e. in the case the backend is bundled and the node_modules removed. Notably the ApplicationPackage as well as the ExtensionPackageCollector are actually coming from the dev-packages, so it can be argued they should not be used at all in Theia itself.
Potential solution
The Theia extension information is already collected during the build process. So instead of re-discovering this information with the tools of dev-packages at runtime, the information could be included in src-gen instead.
