question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nosources Source Maps option

See original GitHub issue

I’d like to obtain full error stack traces with meaningful code lines for bug reporting from obfuscated production code without having to put the source maps on a separate server not accessible by the users.

I’d like something similar to what webpack devTools nosources-source-map option does.

nosources-source-map - A SourceMap is created without the sourcesContent in it. It can be used to map stack traces on the client without exposing all of the source code. You can deploy the Source Map file to the webserver.

Warning It still exposes filenames and structure for decompiling, but it doesn’t expose the original code.

Would it even be feasible with this library also for server-side (node) applications?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
lamuertepeludacommented, Oct 27, 2021

worst part of this so far? even though I use

“sourceMapSourcesMode”: “sources-content”

I see the whole source content inside the .map files 😮

Setting it to sources both removes the content 😌 and solvers the issue in the stack trace.

So, to make it clear to someone else struggling with this on node.js, my working configuration is

{
  "stringArray": true,
  "target": "node",
  "stringArrayRotate": true,
  "exclude": ["node_modules"],
  "sourceMap": true,
  "sourceMapMode": "separate",
  "sourceMapSourcesMode": "sources"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Devtool - webpack
devtool performance production quality (none) build: fastest rebuild: fastest yes bundle eval build: fast rebuild: fastest no generated eval‑cheap‑source‑map build: ok rebuild: fast no transformed
Read more >
Quick guide to webpack source map options - Scott Logic Blog
A quick guide to the available source map options in webpack, and the considerations for choosing one in different scenarios.
Read more >
Source Maps - SurviveJS
nosources -source-map creates a source map without sourcesContent in it. You still get stack traces, though. The option is useful if you don't...
Read more >
Source maps and how it works - Ehsan Gazar
nosources -source-map creates a source map without sourcesContent in it. You still get stack traces, though. The option is useful if you ...
Read more >
How do I generate sourcemaps when using babel and ...
I'm new to webpack, and I need a hand in setting up to generate sourcemaps. I'm running webpack serve from the command line,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found