Skip to content

Broken routerLink on recompile when used with Ivy #32388

Closed

Description

@vajahath

🐞 bug report

<a routerLink="hiya">link</a>

The routerLink breaks when application recompiles. On browser, this is shown as an anchor tag that is not clickable.

This works correctly when Ivy is turned off.

Affected Package

I hope the issue may be related to @angular/router or may be Ivy

Description

I put the <a routerLink=".." .. in a component inside a lazyloaded module. When we stop the server and npm start again, this works correctly. But again fails on the next compile-on-save.

I turned off the Ivy flag and everything works fine. So this may be related to Ivy.

🔬 Minimal Reproduction

I was following the lazy-loading-ngmodules guide.

A very minimal zip is attached here (without node_modules).
broken-routerLink.zip

🔥 Exception or Error

No errors are shown.

🌍 Your Environment

Angular Version:


Angular CLI: 8.3.1
Node: 10.16.2
OS: linux x64
Angular: 8.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.1
@angular-devkit/build-angular     0.803.1
@angular-devkit/build-optimizer   0.803.1
@angular-devkit/build-webpack     0.803.1
@angular-devkit/core              8.3.1
@angular-devkit/schematics        8.3.1
@angular/cli                      8.3.1
@ngtools/webpack                  8.3.1
@schematics/angular               8.3.1
@schematics/update                0.803.1
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Activity

  1. added this to the needsTriage milestone on Aug 29, 2019
  2. added
    area: compilerIssues related to `ngc`, Angular's template compiler
    on Aug 29, 2019
  3. modified the milestones: needsTriage, Backlog on Sep 5, 2019
  4. browsermage commented on Nov 2, 2019

    @browsermage

    Not sure if it matters but I am having the same issue.
    it happens if I modify and re-save the template file.
    If i use [routerLink] it will not recognise the attr
    and if i type it like routerLink it will just ignore it
    ng-reflect-router-link is not applied.

  5. removed this from the Backlog milestone on Nov 9, 2019
  6. 5 remaining items

  7. assigned and unassigned on Nov 13, 2019
  8. angular-automatic-lock-bot commented on Dec 21, 2019

    @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.

  9. locked and limited conversation to collaborators on Dec 21, 2019
  10. added
    regressionIndicates than the issue relates to something that worked in a previous version
    and removed on Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: compilerIssues related to `ngc`, Angular's template compilerfreq1: lowregressionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions