Skip to content

Production build sourcemaps mismatch - line number misalignments #8978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
un33k opened this issue Dec 22, 2017 · 3 comments
Closed

Production build sourcemaps mismatch - line number misalignments #8978

un33k opened this issue Dec 22, 2017 · 3 comments
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@un33k
Copy link

un33k commented Dec 22, 2017

Request Type

bug [x] This is a bug report

Versions

Angular CLI: 1.6.1
Node: 8.6.0
OS: darwin x64
Angular: 5.2.0-beta.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

@angular/cdk: 5.0.1
@angular/cli: 1.6.1
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.0.1
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.6.2
webpack: 3.10.0

macOS: darwin x64 (High Sierra)

Repro steps

  • ng serve (step through the *.ts & line numbers match)
  • ng build --env=staging --prod (deploy on staging - hitting a problem that only shows on prod)
  • ng build --env=staging --prod --sourcemap (step through the *.ts & line numbers don't match)

Observed behavior

Put a breakpoint on line #1, then single step the code, it jumps to line #11.

1    if (headers.has('Message-Count')) {
2      this.messageCount = headers.get('Message-Count');
3    }
     ... (removed for brevity)
10   if (this.localSignature !== this.remoteSignature) {
11     this.statusChanged();
12   }

Desired behavior

Properly built sourcemap should have landed on line #10 when single stepping the code & only on line #11 if the condition on #10 was true.

Mention any other details that might be useful (optional)

I do remember seeing sourcemap misalignment in the beta version. This might be related. While debugging during dev works great, some bugs only show up on prod version and during staging, one should be able to step the prod code and investigate a fix.

@un33k un33k changed the title Production builds sourcemap mismatch - line number misalignments Production build sourcemaps mismatch - line number misalignments Dec 22, 2017
@filipesilva
Copy link
Contributor

Heya, can you provide a repro that includes such a piece of code that sourcemaps ignore on a new project please? It might be related to uglification or some code optimizations, but I can only investigate with real code that shows this behaviour.

We had sourcemap troubles in the past, and quite recently on prod builds only, so I'd like to get to the bottom of this.

@filipesilva filipesilva self-assigned this Dec 26, 2017
@filipesilva filipesilva added needs: repro steps We cannot reproduce the issue with the information given P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Dec 26, 2017
@filipesilva filipesilva added needs: repro steps We cannot reproduce the issue with the information given and removed needs: repro steps We cannot reproduce the issue with the information given P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Feb 1, 2018
@alan-agius4
Copy link
Collaborator

I'm sorry, but we can't reproduce the problem following the instructions you provided.
Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue.
Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.

If the problem persists, please open a new issue following our submission guidelines.

A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

3 participants