flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

Angular 5 support

Open esmeneev opened this issue 9 years ago • 6 comments

Right now flex-layout uses deprecated OpaqueToken. It prevents us from upgrading app that uses Angular 4 to Angular 5.

Bug, feature request, or proposal:

Make flex-layout work with Angular 5.

What is the expected behavior?

Angular application that was upgraded to Angular 5 is served or built successfully.

What is the current behavior?

ERROR in /%PATH_TO_NODE_MODULES%/node_modules/@angular/flex-layout/media-query/breakpoints/break-points.d.ts (8,10): Module '"/%PATH_TO_NODE_MODULES%/node_modules/@angular/core/core"' has no exported member 'OpaqueToken'.

esmeneev avatar Nov 01 '17 18:11 esmeneev

I changed my import of FlexModule from this:

FlexLayoutModule.forRoot()

To this:

FlexLayoutModule

And re-ran ng serve and it seems like the error is gone, at least for me, using Flex layout beta 10 and Angular CLI 1.5 RC 8.

alligatorio avatar Nov 01 '17 19:11 alligatorio

What version are you on? https://github.com/angular/flex-layout/blob/master/CHANGELOG.md#200-beta10-2017-10-31 is out (since yesterday) and supports Angular v5.

Splaktar avatar Nov 01 '17 19:11 Splaktar

@esmeneev - Latest Flex-Layout already uses InjectionToken. check here. I would suggest doing a reinstall of flex-layout 2.0.0-beta.10

mrsan22 avatar Nov 01 '17 21:11 mrsan22

I don't know how, but I had an rc.1 installed which is "later" than beta.10, so looking in my package lock file (using a recent version of npm! also I think shrinkwrap does this) showed me that. I blew away my node modules folder for it and reinstalled but it grabbed the rc from my machine's npm cache. I need to go but I assume this is the issue (RC being older than beta 10 and the dep being specified like "@angular/flex-layout": "^2.0.0-beta.10". I'll update once I test in the morning.

PaluMacil avatar Nov 01 '17 21:11 PaluMacil

@Splaktar @mrsan22 thanks for your help. I actually resolved the issue.

Problem was that before updating to angular 5, I had "@angular/flex-layout": "^2.0.0-rc.1" in package.json. After update I changed it to "@angular/flex-layout": "^2.0.0-beta.10", and installed packages, but npm somehow concluded that flex-layout doesn't need to be upgraded.

Change to "@angular/flex-layout": "2.0.0-beta.10",, removal of node_modules and npm install made it work.

esmeneev avatar Nov 01 '17 23:11 esmeneev

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.