Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Support for Angular 5 #68

Closed
slavede opened this issue Nov 7, 2017 · 13 comments
Closed

Support for Angular 5 #68

slavede opened this issue Nov 7, 2017 · 13 comments

Comments

@slavede
Copy link

slavede commented Nov 7, 2017

I think you can update

"@angular/core": ">=4.0.0 <5.0.0 || >=4.0.0-beta <5.0.0",
"@angular/forms": ">=4.0.0 <5.0.0 || >=4.0.0-beta <5.0.0"

and build it to include Angular5.

Do you need to update something in your code to work with Angular 5?

It really prevents updating Angular to 5.0.

Now, if I try to build my app with Angular 5.0.0. I get:

ERROR in ./node_modules/rxjs/_esm5/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (project\node_modules\typescript\lib\typescript.js:9341:17)
    at assignContextualParameterTypes (project\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (project\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (project\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (project\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (project\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (project\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (project\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (project\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (project\node_modules\typescript\lib\typescript.js:44563:16)
    at checkSourceElement (project\node_modules\typescript\lib\typescript.js:46742:28)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (project\node_modules\typescript\lib\typescript.js:41990:21)
    at checkDeferredNodes (project\node_modules\typescript\lib\typescript.js:46828:25)
    at checkSourceFileWorker (project\node_modules\typescript\lib\typescript.js:46863:17)
    at checkSourceFile (project\node_modules\typescript\lib\typescript.js:46842:13)
    at Object.forEach (project\node_modules\typescript\lib\typescript.js:1506:30)
 @ ./node_modules/rxjs/_esm5/observable/bindNodeCallback.js 2:0-76
 @ ./node_modules/rxjs/_esm5/add/observable/bindNodeCallback.js
 @ ./node_modules/rxjs/_esm5/Rx.js
 @ ./node_modules/ngx-tree-select/bundle/ngx-tree-select.es5.js
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts
ERROR in ./node_modules/rxjs/_esm5/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (project\node_modules\typescript\lib\typescript.js:9341:17)
    at assignContextualParameterTypes (project\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (project\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (project\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (project\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (project\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (project\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (project\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (project\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (project\node_modules\typescript\lib\typescript.js:44563:16)
    at checkSourceElement (project\node_modules\typescript\lib\typescript.js:46742:28)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (project\node_modules\typescript\lib\typescript.js:41990:21)
    at checkDeferredNodes (project\node_modules\typescript\lib\typescript.js:46828:25)
    at checkSourceFileWorker (project\node_modules\typescript\lib\typescript.js:46863:17)
    at checkSourceFile (project\node_modules\typescript\lib\typescript.js:46842:13)
    at Object.forEach (project\node_modules\typescript\lib\typescript.js:1506:30)
 @ ./node_modules/rxjs/_esm5/observable/bindCallback.js 2:0-68
 @ ./node_modules/rxjs/_esm5/add/observable/bindCallback.js
 @ ./node_modules/rxjs/_esm5/Rx.js
 @ ./node_modules/ngx-tree-select/bundle/ngx-tree-select.es5.js
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
@slavede
Copy link
Author

slavede commented Nov 7, 2017

Additional info: I've tried to fork your repo and build it locally, but I get a lot of webpack issues which I didn't have time to understand, so I've tried to take source of your project and include it as a module to my project which is angular 5 base, and it works quite fine so I guess you just have to provide build with angular5

@Crazyht
Copy link
Owner

Crazyht commented Nov 7, 2017

I update to angular 5 soon, just need few time to test upgrade (and if I can continue to use in angular 4 project).

When I see your error stack, I suppose RxJs is updated too?

@slavede
Copy link
Author

slavede commented Nov 8, 2017

Yes it did.

Only one thing you'll have to do is in select.service.ts.

Change

import { Subject } from 'rxjs/Rx';

to

import { Subject } from 'rxjs/Subject';

@slavede
Copy link
Author

slavede commented Nov 15, 2017

Hey, did you manage to merge it?

@Crazyht
Copy link
Owner

Crazyht commented Nov 15, 2017

Hi,

I start to try, but lot of changes on build process/webpack and short time to work on it.

@Crazyht
Copy link
Owner

Crazyht commented Dec 5, 2017

Hi sorry for long time, my job take large part. I need to made some little changes on ng4 version, you think is right if I fix import for rxjs and remove <5.0.0 in package.json ?

I watch how can build in ng 5 but lot of change in build process and in this case I think component are not anymore compatible with ng 4.

@slavede
Copy link
Author

slavede commented Dec 6, 2017

Yeah, you should be able to do that and then use ng-packagr to build it...

@Thorski
Copy link

Thorski commented Dec 8, 2017

I also am getting this error. Need to change 'rxjs/Rx' to 'rxjs/Subject'.

@slavede
Copy link
Author

slavede commented Dec 8, 2017

Yeah, that's just proper way of importing it...you should have do it for ng4 as well, but here, they are more strict.

@slavede
Copy link
Author

slavede commented Dec 12, 2017

Any success?

Crazyht pushed a commit that referenced this issue Dec 12, 2017
fix: Change Angular version support (#68)
@Crazyht
Copy link
Owner

Crazyht commented Dec 13, 2017

I have made change, I fix 2 other bugs and publish new version.

@Crazyht
Copy link
Owner

Crazyht commented Dec 13, 2017

Try 0.13.0 (same build just make adaptation for rx and peerDependency)

@slavede
Copy link
Author

slavede commented Dec 18, 2017

Well, it seems fine to me now. Thanks!

@slavede slavede closed this as completed Dec 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants