Closed giard-alexandre closed 5 years ago
Same for me, using Angular 6.0.3
and RxJS 6.0.0
with compat installed.
ERROR in node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/angular4-hal/dist/src/rest.service.d.ts(28,40): error TS2314: Generic type 'ErrorObservable<T>' requires 1 type argument(s).
node_modules/angular4-hal/dist/src/rest.service.d.ts(29,47): error TS2314: Generic type 'ErrorObservable<T>' requires 1 type argument(s).
node_modules/angular4-hal/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/angular4-hal/node_modules/rxjs/internal/symbol/observable.d.ts(4,18): error TS2687: All declarations of 'observable' must have identical modifiers.
Temporary fix:
"include": ["../node_modules/angular4-hal/**/*.ts"]
into tsconfig.app.json (or your tsconfig.json file)"exclude": ["./node_modules/angular4-hal/**.spec.ts"]
to the same file above(point 3 is perhaps not needed since I don't see any unit tests)
please make a pull request
@sante85 This does not fix the library. As I said, this is a temporary solution.
Am I correct in assuming that this error is caused due to the fact that the app's source code is being included with the compiled code?
@heuristicAL Yep, that might be true. The NPM package seems to be broken so in order to make it works you need to include either compiled lib + bindings or the source code (not both). I didn't really have much time to 100% investigate the reason why it got corrupted so I might be wrong, too.
@sante85 I'm not too sure if we can fix this issue using pull requests as we don't have access to the current build process for this lib. Seems to be a problem at build/packaging level, maybe caused by the fact that the source code and node_modules are included with the compiled output. It may be fixed by removing the source code and only including the compiled output.
I created a pull request (first time I've ever done this!). When I build against my changes and copy them into the node_modules/angular4-hal/dist folder, my app has no further issues with Angular 6.
I created a fork of this project and published the build on npmjs and now everything works fine
https://github.com/mpbalmeida/hal-4-angular https://www.npmjs.com/package/hal-4-angular
You can use this build until the build process of this project is fixed.
The fork worked even without rxjs-compat.
Current (6.1.0) gives me
"ERROR in node_modules/angular4-hal/dist/src/rest.service.d.ts(28,40): error TS2314: Generic type 'ErrorObservable<T>' requires 1 type argument(s).
node_modules/angular4-hal/dist/src/rest.service.d.ts(29,47): error TS2314: Generic type 'ErrorObservable<T>' requires 1 type argument(s)."
fixed it by adding <any>
after ErrorObservable on each line. Don't know what to change in source code though.
@mpbalmeida can you give hints about what to change about the build process?
Or could you update your fork with the latest fixes from here?
@felixfiskare I just update the version 6.1.0, it should be ok. I run an automated build with circle-ci.
You can also post issues on my fork.
@felixfiskare -I also experienced the same issue:
"ERROR in node_modules/angular4-hal/dist/src/rest.service.d.ts(28,40): error TS2314: Generic type 'ErrorObservable
Am working on an another pull request to hopefully resolve it. I'm also go attempt to make it Angular 6.1.1 compliant too.
Hi , Iam getting this error ' error in library saying can’t convert type null/undefined to an object.' when Iam trying to display all the albums in the UI, Iam not able to figure this out, can someone please help.. Iam able to display one album in the ui but unable to display all the albums and get the below error
Hi! Data provided by your API is not HATEOAS compatible. Library expects somethig like: Try to put a break point in browser (Chrome?) in the beginning of the instantiateResourceCollection() and see what the payload parameter looks like.
ok, i will try that . But I have set this up as my endpoint https://github.com/adrianmilne/spring-hateoas-demo , i think it should work..
so I checked the format nd it looks correct,Iam not able to figure this out..
Can someone please help
You have no "_embedded" and "_links" section in the top level collection itself. And the failing method expects '_embedded', see "for" loop in the beginning of the method. Unfortunately I can't help you with java spring end point, I'm on ASP.Core API.
I'm getting some errors when compiling the project using
Angular 6.0.5
andRxJS 6.2.1
. I am using rxjs-compat as I get even more errors if I try to compile it without the compatibility shim. I don't know if I am missing something but I would appreciate some help! Thanks! Here is the error:PS: After some quick searching, it may be caused by the fact that you have 2 node_modules in the library.