-
Notifications
You must be signed in to change notification settings - Fork 6.2k
-
I work for a shop that uses code-server as interactive lab environments. We're trying to resolve a bug with the built-in terminal and it would be helpful to get javascript debugging working for code-server.
Is there some way to build with javascript map files? I don't see any options in any of the package.json files, which is what I might expect for doing a "dev" build of the javascript files The file I'd likely need to debug (xterm.js) is in minified javascript, which does not lend itself to debugging, unfortunately.
Any way to do this?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 3 replies
-
code-server is supposed to include the map files by default but I think there is a bug unfortunately. Have not had time to look into it. I am not sure if the map files are not being included at all, or if they exist but are not being served correctly.
The issue might be somewhere in the VS Code build process, amongst all the Gulp files probably. Might be something wrong with our patch: https://github.com/coder/code-server/blob/main/patches/sourcemaps.diff
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for your quick reply. I'm still trying to figure out where the source files are being served from. On an Ubuntu install using the install.sh script, where would I expect to find the map files is the build works correctly, and isn't stripped out by this potential bug?
Beta Was this translation helpful? Give feedback.
All reactions
-
A quick look at my instance in the debugger suggests that there are some maps, but specifically NOT a map for xterm.js, which appears to be minified JS. Is it possible to build code-server such that xterm is properly instrumented?
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh right xterm.js
actually comes from a dependency but it does include a map file, in the same directory as xterm.js
.
I tried loading /stable-3c5deac16d0b3620cce8abca637012904ea6520e/static/node_modules/@xterm/xterm/lib/xterm.js.map
and that worked so it seems both available and accessible.
Firefox seems to recognize it, there is a button I can click to open the source map in a separate tab, but it will not show the original source in the debugger for some reason. 😕
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh wait I was just confused, xterm.js
is the bundle but it does look like the original xterm/src/**.ts
files are showing up for me and debugging them is working.
Beta Was this translation helpful? Give feedback.