vscodium: dont fetch online sourcemaps on runtime

Describe the bug

many javascript files in lib/vscode/resources/ have online sourcemaps

example:

$ tail -n1 /nix/store/0y692yyqc4gdx0i6k22hc7nzswxqqg9p-vscodium-1.71.2.22258/lib/vscode/resources/app/out/bootstrap.js
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/cea9d1a4b17966719d8c5f3cdd914480f7cec47c/core/bootstrap.js.map

this is unwanted because

  1. vscodium should work offline
  2. vscodium should not call home to windows.net (telemetry)

Please confirm that this problem is VSCodium-specific

  • This bug doesn’t happen if I use Microsoft’s Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn’t already documented

Additional context Add any other context about the problem here.

on nixos linux …

find /nix/store/0y692yyqc4gdx0i6k22hc7nzswxqqg9p-vscodium-1.71.2.22258/lib/vscode/resources/ -name '*.js' | xargs tail -n1 -q | sed 's|//# sourceMappingURL=|\n&|g' | grep -E -o 'https://.*?\.js\.map' >/tmp/vscodium-online-sourcemaps.txt

vscodium-online-sourcemaps.txt

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

To be useful, the sourcemaps need to hosted somewhere since MS don’t include them since they would increase the install size of the app.

vscodium should work offline

Since the url needs to be hardcoded, to use a local url would be difficult (for all systems). And the weight of those files can be an issue to include them adhoc.

It only an issue to debug vscode or one of its components.

I think this needs to be an option- I can’t debug my vscodium without these source maps, so they should be included. For the VSCodium that’s downloadable on GitHub, we can assume nobody will use the source map so the sourceMappingURL line can be removed, or the domain name replaced with a .invalid domain.

One may just turn off “Enable JavaScript source maps” in the Chromium Dev Tools settings:

Chromium Dev Tools settings

This is electron.devtools.preferences.jsSourceMapsEnabled: "true" | "false" (yes, string), in the <user data directory, see this>/Preferences file, a JSON file without a proper .json suffix.

Since we have good reasons, maybe we can just preload this preference and tell user about this change somewhere.


But...

This is related to a larger topic: Should the Web Dev Tools fetch source maps automatically? Should source map errors be printed on the main console?

Personally, I want Dev Tools do nothing when I launch them, but fetch the source map when I inspect a source. The source map fetch errors should be printed to somewhere else, like Firefox’s browser console. Maybe just leave one info level message on the main console, to indicate there is source map error(s) on this Dev Tools instance.

Source map is just for convenience, not essential. It shoule be fetched on demand, not unconditionally.

Maybe a script that do all of that??? Locate the app, get the version, download the maps and update the urls… ???

Hum, Snap, AppImage and macOS might be an issue.

To be useful, the sourcemaps need to hosted somewhere since MS don’t include them since they would increase the install size of the app.

vscodium should work offline

Since the url needs to be hardcoded, to use a local url would be difficult (for all systems). And the weight of those files can be an issue to include them adhoc.

It only an issue to debug vscode or one of its components.