forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 558
Open
Description
Description
Command links in VS Code walkthrough markdown files fail to execute with a Cannot read properties of undefined (reading 'length') error. This breaks basic walkthrough functionality, like linking to commands in the walkthrough body or to external links.
Reproduction instructions
- Run OpenVSCode Server (linuxserver/openvscode-server:latest)
docker run -d --name=openvscode-server \ -e PUID=1000 -e PGID=100 \ -p 3000:3000 \ -v ./config:/config \ lscr.io/linuxserver/openvscode-server:latest - Open http://localhost:3000
- Open Command Palette → "Get Started: Open Walkthrough"
- Open any walkthrough with command links in markdown - you can use
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SAPSE/vsextensions/sap-ux-application-modeler-extension/latest/vspackage - Click any command link (e.g.
Learn More) - Observe no-launch, and an accompanying error in the devtools console.
workbench.js:38 ERR Cannot read properties of undefined (reading 'length'): TypeError: Cannot read properties of undefined (reading 'length')
at uN (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:29:59536)
at wc (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:30:64992)
at She.value (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:3987:16362)
at E.C (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:29:2349)
at E.fire (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:29:2568)
at http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:4257:12399
at http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:4257:17142
at Set.forEach (<anonymous>)
at H.onmessage (http://localhost:3000/stable-072586267e68ece9a47aa43f8c108e0dcbf44622/static/out/vs/code/browser/workbench/workbench.js:4257:17131)Possible issue
It looks like the error occurs in the webview message handler (suggested by H.onmessage in logs) when processing command execution requests from walkthrough markdown. Then the uN function tries to read .length on an undefined args array.
Extra context
- This issue does not occur in desktop VS Code, not other popular image (coder/code-server - they seem to have a number of patches applied at build time - I believe this might be the fix - https://github.com/coder/code-server/blob/main/patches/webview.diff and https://github.com/coder/code-server/blob/main/patches/service-worker.diff).
- This would add origin validation bypass for the same-host webviews and simplification of service worker registration, which would prevent request interception.
- The PR Don't sanitize
commandURLs in getting started #176 fixed the sanitisation, but not this execution issue. - A possible fix could be to apply the patches mentioned above
ENV
Version: 1.109.5
Commit: 0725862
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Embedder: openvscode-server
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels