Skip to content

Sourcemaps for .d.ts files break go to definition in vscode #34446

Closed

Description

@tmair

🐞 bug report

Affected Package

All core packages

Is this a regression?

This is new in version 9 of Angular

Description

In version 9 of Angular the core.d.ts file contains a sourcemap link to the core.d.ts.map file. The sourcemap file itself also contains the source of the d.ts file itself. This throws off the vscode tsserver implementation with the result that go to definition is broken for angular projects.

🔬 Minimal Reproduction

Steps to Reproduce:

  1. Install Angular CLI
  2. Create new project ng new shiny-ivy-app --enable-ivy
  3. Build project ng serve
  4. Open the project with vscode
  5. Open app.component.ts and try to go to definition for Component

🔥 Exception or Error

microsoft/TypeScript#35014

🌍 Your Environment

Angular Version:


Angular CLI: 9.0.0-rc.5
Node: 12.10.0
OS: darwin x64

Angular: 9.0.0-rc.5
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.0-rc.5
@angular-devkit/build-angular      0.900.0-rc.5
@angular-devkit/build-ng-packagr   0.900.0-rc.5
@angular-devkit/build-optimizer    0.900.0-rc.5
@angular-devkit/build-webpack      0.900.0-rc.5
@angular-devkit/core               9.0.0-rc.5
@angular-devkit/schematics         9.0.0-rc.5
@ngtools/webpack                   9.0.0-rc.5
@schematics/angular                9.0.0-rc.5
@schematics/update                 0.900.0-rc.5
ng-packagr                         9.0.0-rc.3
rxjs                               6.5.3
typescript                         3.6.4
webpack                            4.41.2

Visual Studio Code

Version: 1.41.0
Commit: 9579eda04fdb3a9bba2750f15193e5fafe16b959
Date: 2019-12-11T17:58:38.338Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.2.0

Anything else relevant?
There is already an issue open for this issue in the TypeScript repository. However I believe it is relevant for everybody who is using vscode to develop their angular application.

Activity

  1. added
    area: compilerIssues related to `ngc`, Angular's template compiler
    on Dec 17, 2019
  2. added this to the needsTriage milestone on Dec 17, 2019
  3. added
    area: packagingIssues related to Angular's creation of npm packages
    and removed
    area: compilerIssues related to `ngc`, Angular's template compiler
    on Jan 21, 2020
  4. tmair commented on Jan 29, 2020

    @tmair
    ContributorAuthor

    The issue in the TypeScript repository has been resolved.

  5. xsegrity commented on Feb 26, 2020

    @xsegrity

    Yea, the issue (microsoft/TypeScript#35014) has been closed/resolved but it doesn't actually fix this problem. They opened another (microsoft/TypeScript#36407) to handle this.

  6. modified the milestones: needsTriage, Backlog on Jun 1, 2020
  7. IgorMinar commented on Jun 1, 2020

    @IgorMinar
    Contributor

    Hi there, there are several issues with our source maps, so I'm not sure if one of them is the root cause of the problem you reported, or if this is yet another one. We'll need to investigate this more.

    Related issues:

  8. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    and removed on Oct 1, 2020
  9. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    This is an upstream issue for TS/VS Code in my opinion. It is perfectly reasonable to generate inline source content in source-map files. The fact that TS services cannot handle this is not the fault of the Angular build. The source-mapping works fine when debugging in the browser. Also, the half-fix that TS has provided in microsoft/TypeScript#36384 appears to work well enough as far as I can tell.

    So @jelbourn I would mark this more like P5.

  10. petebacondarwin commented on Oct 19, 2020

    @petebacondarwin
    Contributor

    Tracking the underlying problem in our build system at #14021

  11. angular-automatic-lock-bot commented on Nov 19, 2020

    @angular-automatic-lock-bot

    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.

  12. locked and limited conversation to collaborators on Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: packagingIssues related to Angular's creation of npm packagesfreq3: highstate: needs more investigationtype: bug/fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions