Currently in worker-mainimportScripts is used to load the plugin-vscode-init-fe.ts. However, this does not work for instances, where Theia is not hosted at the base-url (or origin), like the try.theia-cloud.io deployment, where each instance of Theia is hosted under ws.theia-cloud.io/<pod-id>.
After a quick investigation the problem seems to be that importScripts is called with /context/<file-name>, which is a absolute path. Hence it resolves to only base-url/context/<file-name>, whereas we would need base-url/<pod-id>/context/<file-name>. This could be fixed by simply calling importScripts with ./context/<file-name>. I already tested this and it seems to work.
Does anyone have any concerns about that change? It should not change the behavior for other use cases, but fix the issue for that specifc scenario.
I can gladly contribute this.
Steps to Reproduce:
Use a hosted Theia instance that is running under a path (e.g. https://try.theia-cloud.io/ - path meaning, that the pods are running under ws.theia-cloud.io/<pod-id> and not just ws.theia-cloud.io)
Install a frontend-only vscode extension
Observe that the console throws and error that the plugin-vscode-init-fe.js fails to load.
Bug Description:
Currently in worker-main importScripts is used to load the plugin-vscode-init-fe.ts. However, this does not work for instances, where Theia is not hosted at the base-url (or origin), like the
try.theia-cloud.io
deployment, where each instance of Theia is hosted underws.theia-cloud.io/<pod-id>
.After a quick investigation the problem seems to be that
importScripts
is called with/context/<file-name>
, which is a absolute path. Hence it resolves to onlybase-url/context/<file-name>
, whereas we would needbase-url/<pod-id>/context/<file-name>
. This could be fixed by simply callingimportScripts
with./context/<file-name>
. I already tested this and it seems to work.Does anyone have any concerns about that change? It should not change the behavior for other use cases, but fix the issue for that specifc scenario.
I can gladly contribute this.
Steps to Reproduce:
https://try.theia-cloud.io/
- path meaning, that the pods are running underws.theia-cloud.io/<pod-id>
and not justws.theia-cloud.io
)plugin-vscode-init-fe.js
fails to load.Additional Information