Skip to content

ivy: flex-layout directives cause runtime errors with 9.0.0 #32064

Closed

Description

@naveedahmed1

Bug Report

What is the expected behavior?

flex-layout should support Angular IVY

What is the current behavior?

When compiling angular app that uses flex-layout and has IVY enabled, the app compiles successfully, but when running in browser, it doesn't display anything on screen and throws below error in developer console:

(2,25): Cannot invoke an expression whose type lacks a call signature. Type '{ ngStyle: any; (Missing): number; }' has no compatible call signatures.
src/app/test/mycomponent.component.html(2,25): Cannot find name 'ngStyle'.
src/app/test/mycomponent.component.html(2,25): Cannot find name 'xs'.

What are the steps to reproduce?

Adding below code to an app using flex-layout, should throw the above error:

<div id="myDiv" [ngStyle.gt-xs]="{'margin-left.px':-16,'margin-right.px':-16,'margin-top.px':-16}">
</div>

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular CLI: 8.3.0-next.0
Node: 10.16.0
OS: win32 x64
Angular: 9.0.0-next.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.803.0-next.0
@angular-devkit/build-angular              0.803.0-next.0
@angular-devkit/build-optimizer            0.803.0-next.0
@angular-devkit/build-webpack              0.803.0-next.0
@angular-devkit/core                       8.3.0-next.0
@angular-devkit/schematics                 8.3.0-next.0
@angular/cdk                               8.1.2
@angular/cli                               8.3.0-next.0
@angular/fire                              5.2.1
@angular/flex-layout                       8.0.0-beta.26
@angular/http                              8.0.0-beta.10
@angular/material                          8.1.2
@angular/material-moment-adapter           8.1.2
@angular/pwa                               0.803.0-next.0
@ngtools/webpack                           8.3.0-next.0
@nguniversal/module-map-ngfactory-loader   8.1.1
@schematics/angular                        8.3.0-next.0
@schematics/update                         0.803.0-next.0
rxjs                                       6.5.2
typescript                                 3.4.5
webpack                                    4.38.0

Activity

  1. naveedahmed1 commented on Aug 8, 2019

    @naveedahmed1
    ContributorAuthor

    @Splaktar should this be reported on Angular repo, just came across this comment by @CaerusKaru

    angular/flex-layout#1072 (comment)

    Any issue with compiling with Ivy is strictly an Ivy issue, as it’s meant to be backwards.compatible with ViewEngine.

  2. Splaktar commented on Aug 8, 2019

    @Splaktar
    Contributor

    Yes, I believe so, and we can transfer it if needed.

  3. changed the title [-]ngStyle.gt-xs not compatible with Angular IVY 9.0.0-next.0[/-] [+]ivy: flex-layout directives don't compile with 9.0.0-next.0[/+] on Aug 8, 2019
  4. Splaktar commented on Aug 8, 2019

    @Splaktar
    Contributor

    I don't know if things are better in 9.0.0-next.1, but it just came out if you want to try it.

  5. Splaktar commented on Aug 8, 2019

    @Splaktar
    Contributor

    Oh, it looks like I don't have permission to transfer issues to angular/angular.

  6. naveedahmed1 commented on Aug 8, 2019

    @naveedahmed1
    ContributorAuthor

    Thank you @Splaktar for your reply. I have tried it with 9.0.0-next.1 as well, but it throws same error.

  7. naveedahmed1 commented on Aug 8, 2019

    @naveedahmed1
    ContributorAuthor

    The app compiles successfully but when running in the browser it throws the above error in developer console, and nothing is displayed on the screen.

  8. changed the title [-]ivy: flex-layout directives don't compile with 9.0.0-next.0[/-] [+]ivy: flex-layout directives cause runtime errors with 9.0.0[/+] on Aug 9, 2019
  9. transferred this issue fromangular/flex-layouton Aug 9, 2019
  10. modified the milestone: needsTriage on Aug 9, 2019
  11. 8 remaining items

  12. kara commented on Aug 29, 2019

    @kara
    Contributor

    @naveedahmed1 DefaultStyleDirective in the stack trace is something from flex-layout, not Angular core, so that's specific to the lib.

    Regarding this comment:

    Any issue with compiling with Ivy is strictly an Ivy issue, as it’s meant to be backwards.compatible with ViewEngine.

    That's actually not true. There are some minor changes that will require application updates, not Ivy updates. These will mostly be accomplished through automated schematics for version 9, but until those are ready, you may see some errors that are not Ivy bugs but expected changes.

  13. naveedahmed1 commented on Aug 29, 2019

    @naveedahmed1
    ContributorAuthor

    So can you please transfer the issue back to flexlayout repository?

  14. kara commented on Aug 29, 2019

    @kara
    Contributor

    @mhevery Can you help? (I don't have permissions in the other repo)

  15. Nodarii commented on Sep 2, 2019

    @Nodarii

    I experience the same issue during migration from 8.2.0 to 9.0.0.next.4. So now this issue blocks migration

  16. Splaktar commented on Oct 10, 2019

    @Splaktar
    Contributor

    @Nodarii with what version of Flex Layout?

  17. naveedahmed1 commented on Oct 10, 2019

    @naveedahmed1
    ContributorAuthor

    I ended up removing Flex-Layout, from my project and now using to CSS Flexbox + BreakpointObserver Service from Angular Material, since I'm already using Angular Material. One less dependency and life is peaceful :D

  18. Nodarii commented on Oct 11, 2019

    @Nodarii

    @Splaktar It was 8.0.0-beta.26

  19. Splaktar commented on Oct 11, 2019

    @Splaktar
    Contributor

    @Nodarii I hope that you are unblocked now with 8.0.0-beta.27?

  20. klagrida commented on Oct 13, 2019

    @klagrida
    Contributor

    I have this error when i run : ng build --prod but ng serve work without any error. i use the latest version of angular : 9.0.0-next.10 . I use 8.0.0-beta.27 for flex-layout.

  21. petebacondarwin commented on Dec 9, 2019

    @petebacondarwin
    Contributor

    Please try with the next versions of Angular (9.0.0-rc.5) and flex-layout (8.0.0-beta.27)

  22. Nodarii commented on Dec 9, 2019

    @Nodarii

    It works for me

  23. petebacondarwin commented on Dec 9, 2019

    @petebacondarwin
    Contributor

    Great. Thanks for letting us know @Nodarii

  24. angular-automatic-lock-bot commented on Jan 9, 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.

  25. locked and limited conversation to collaborators on Jan 9, 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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions