Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to build coder-server with javascript/typescript debugging map files #7484

Unanswered
torenware asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 2 comments 3 replies

Comment options

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

You must be logged in to vote
0 replies
Comment options

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?

You must be logged in to vote
3 replies
Comment options

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?

Comment options

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. 😕

Comment options

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /