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

Unable to use the debug functionality when used as a web extension #81

Open
billti opened this issue Nov 10, 2022 · 0 comments
Open

Unable to use the debug functionality when used as a web extension #81

billti opened this issue Nov 10, 2022 · 0 comments

Comments

@billti
Copy link
Member

billti commented Nov 10, 2022

Using this example as a web extension doesn't appear to work - at least when tested as per the VS Code docs. It appears from recent commits (e.g. 354c0e9) this should be supported.

I've cloned this repo and built, and I'm trying to test as outlined at https://code.visualstudio.com/api/extension-guides/web-extensions#test-your-web-extension .

When I try I on vscode.dev (or github using the "open in github.dev" option) and load the locally built extension as outlined using npx serve and npx localtunnel I see CORS errors in the console as shown below, and the extension is not available.

Refused to connect to 'https://eager-otters-kick-67-183-2-129.loca.lt/package.json' because it violates the following Content Security Policy directive: "connect-src 'self'
            wss://vsls-prod-ins-usw2-private-relay.servicebus.windows.net
            wss://vsls-prod-rel-usw2-relay-1.servicebus.windows.net
            wss://vsls-prod-rel-usw2-relay-2.servicebus.windows.net

When I try as outlined in the docs using @vscode/test-web (e.g. running the command vscode-test-web --extensionDevelopmentPath=. . from the package.json) then I can see the extension is loaded and I can set a breakpoint in the .md file in the workspace, but on trying to debug via the command "Mock Debug: Debug File" then the debugger appears to launch but just sits there, and in the console output I see the below error (truncated):

Uncaught (in promise) Error (FileSystemError): Unable to read file '/vscode-test-web://mount/README.md' (Unavailable (FileSystemError): Error: No file system handle registered (/vscode-test-web:/))
	at Yt._handleError (../../../vs/workbench/api/worker/extensionHostWorker.js:76:30420)
	at Object.readFile (../../../vs/workbench/api/worker/extensionHostWorker.js:76:28894)
	at async Object.readFile (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:4303:12)
	at async MockRuntime.loadSource (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:3335:31)
	at async MockRuntime.verifyBreakpoints (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:3462:7)
	at async MockRuntime.setBreakPoint (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:3241:5)
	at async eval (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:3652:38)
	at async Promise.all (index 0)
at async _MockDebugSession.setBreakPointsRequest (http://localhost:3000/static/devextensions/dist/web-extension.js#vscode-extension:3657:31)

Something I'm doing wrong? Are the docs wrong (or incomplete)? Or is there an issue here? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant