vscode-extension-samples: LSP-WEB sample fails when published together with a different target
The lsp-web-extension-sample
build results in two .js files (browserClientMain.js and browserServerMain.js) (although docs say the extension should consist of a single file only https://code.visualstudio.com/api/extension-guides/web-extensions#web-extension-main-file).
When this extension is packed and published on the marketplace standalone, it can be installed and activated and used on vscode.dev without an issue.
vsce publish -t web
However; for some reason, when we have two extensions with the same ID targeting different platforms, the web extension’s browserServerMain.js
file fails to load - the https://***.vscode-unpkg.net/<publisherid>/<extensionid>/<extensionversion>/server/dist/browserServerMain.js
does not exist, the server returns 404. The file browserClientMain.js
(the “browser” entry point) is there.
first (win32-x64) ext:
vsce publish -t win32-x64
second (web) ext:
vsce publish -t web
Activating the web extension results in a javascript error caused by the 404 above:
Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://****.vscode-unpkg.net/****/****/****/extension/server/dist/browserServerMain.js?target%3Dweb' failed to load.
at blob:https://cb049561-26f3-4410-847a-e2da21253db2.vscode-webview.net/319d41ae-c413-4e45-a41a-4cbc850307df:1:410
at blob:https://cb049561-26f3-4410-847a-e2da21253db2.vscode-webview.net/319d41ae-c413-4e45-a41a-4cbc850307df:1:415
Maybe this is more likely an issue for the marketplace web?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 28 (28 by maintainers)
So then we’re OK? This specific incident might just have happened because FrontDoor had incorrect caching rules, which we have just fixed.
@joaomoreno I can’t actually, and it seems the file from unpkg service is served just fine now.
We have been experimenting with Web extensions for the past two weeks, and the unpkg service was returning 404 for that file. We have tried a lot of deployments, in various orders and combinations, and none of them worked, even with
?target=web
in the URL.It seems, a few days ago, something has changed? since it’s not reproducible anymore, the issue can be closed.
Oh yeah got it. When I use
?target=web
both URLs work just fine:This URL (https://devsense.vscode-unpkg.net/DEVSENSE/phptools-vscode/1.6.8482/extension/) is not showing the correct content tho. It lists the content of the first VSIX (win32-x64). But the content of the second published package (target web) is not listed, although its
main.js
file is there.