Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
We use remote source maps (e.g. //# sourceMappingURL=https://something-deployed/index.js.map), in electron's main and utility processes. Historically, remote source maps for node.js applications could not be resolved by Chrome DevTools.
Now the situation has improved - in Node.js 22.19 they added --experimental-inspector-network-resource flag, which allows applications to manually add support for remote source map resolution
E.g. Imagine i have the following script:
import inspector from 'node:inspector';
async function setNetworkResources() {
const mapUrl = 'http://localhost:4000/index.js.map';
const distAppJsMap = await fetch(mapUrl).then((res) => res.text());
inspector.NetworkResources.put(mapUrl, distAppJsMap);
// TS source is included in the js.map, so we can skip the .ts fetch
};
setNetworkResources().then(() => {
setInterval(() => {
console.log("ping!")
}, 5000)
});
If I compile the code and generate source maps, then run node --inspect=9230 --experimental-inspector-network-resource index.js, I can use Chromes 'dedicated DevTools for Node', and see that it successfully resolves source maps, allowing me to debug the original TS code.
However, the same setNetworkResources doesn't work in electron, because it only supports a subset of Node.js flags.
Proposed Solution
Add support for --experimental-inspector-network-resource CLI flags for both main and utility processes.
Alternatives Considered
The only 'real' alternative is not to have source map resolution for main/utility processes in Chrome inspector (which is the current situation). It's not ideal, because there are developers who prefer using Chrome's inspector over VS Code
Additional Information
Long term, consider implementing setNetworkResources directly in electron (to provide remote source map resolution for all applications "out of the box") - I know it's a long shot, but I do think it might be useful for for other electron applications as well
Activity
Bhumi0189 commentedon Jan 23, 2026