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.

Sourcemaps for legacy JS scripts have absolute path, instead of relative

See original GitHub issue

Versions

angular/cli: 1.4.9
node: 6.11.3
os: win32 x64
@angular/animations: 4.4.6
@angular/common: 4.4.6
@angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6
@angular/router: 4.4.6
@angular/cli: 1.4.9
@angular/compiler-cli: 4.4.6
@angular/language-service: 4.4.6
typescript: 2.3.4

Repro steps

  • Add legacy js scripts to angular-cli.json scripts array
  • Build via "ng build --prod --sm

here is my angular-cli.json:

],
      "scripts": [
        "App.js",
        "modules/module1.js",
        "modules/module2.js"
        ....
]

Observed behavior

Sourcemaps generated for legacy js scripts (scripts.bundle.js) contain relative path, instead js.map looks like this:

{"version":3,"sources":["C:\\Users\\ibalan\\Documents\\Projects\\myproject\\src\\App.js"}

Desired behavior

Sourcemaps should have relative paths, is there is switch or option in a config for this?

When I build with --dev - sourcemap for scripts is not created at all

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
filipesilvacommented, Jan 8, 2018

I just tested on latest master and I see:

  • Absolute paths in app bundles ({"version":3,"sources":["D:/sandbox/master-project/node_modules/rxjs/_esm5/symbol/rxSubscriber.js",)
  • Odd paths for scripts: {"version":3,"sources":["src/scripts.js"],
  • Odd double paths for css bundles {"version":3,"sources":["D:/sandbox/master-project/src/D:/sandbox/master-project/styles.css"]

Something is definitely wrong with sourcemaps here.

1reaction
toddamscommented, Dec 8, 2017

Unfortunately, upgrading to 1.6 did not resolve the issue. I still get absolute paths.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relative SourceMap paths for debugging in WebStorm #238
I'd like to debug an application's JavaScript source files in WebStorm using SourceMaps. However this does not work with SourceMap files ...
Read more >
Import statements in Nodejs with Typescript is not resolving ...
Your absolute imports are accepted by TypeScript compiler because in the tsconfig.json you specified baseUrl to "./src" , which means paths ...
Read more >
Troubleshooting for React | Sentry Documentation
Double-check that your deployed, final JavaScript files have sourceMappingURL present. Alternately, instead of sourceMappingURL , you can set a SourceMap HTTP ...
Read more >
Nodejs debugging - vscode-docs1
Today two wire protocols exist: - legacy: the original V8 Debugger Protocol which is ... program - an absolute path to the Node.js...
Read more >
Emscripten Compiler Frontend (emcc)
The specified file path must be absolute, not relative. ... Instead keep the static initialization inside the generated JavaScript as text.
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