cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Cropper doesn't compile under Angular 5.1.0 #274

Closed bencameron00 closed 6 years ago

bencameron00 commented 6 years ago

I am updating my packages and have moved to the latest version of Angular (5.1.0) When I try to build my app I am getting the below error...

ERROR in C:\Development\TileCase\V2\TileCase.V2.UI\node_modules\ng2-img-cropper\src\exif.ts
(709,38): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
Child html-webpack-plugin for "index.html":
    chunk    {0} index.html 4.12 kB [rendered]
webpack: Failed to compile.

I am using "ng2-img-cropper": "0.7.7",

Any ideas?

meronbrouwer commented 6 years ago

Version 0.9 works with Angular 5.1. Try to upgrade to the latest version of ng2-img-cropper.

Moppet12 commented 6 years ago

@meronbrouwer I'm facing the same problem, but update to 0.9 version didn't resolve the conflict, when I try to run npm install it throws this:

npm WARN ng2-img-cropper@0.9.0 requires a peer of @angular/common@^4.0.0 but none was installed. npm WARN ng2-img-cropper@0.9.0 requires a peer of @angular/compiler@^4.0.0 but none was installed. npm WARN ng2-img-cropper@0.9.0 requires a peer of @angular/core@^4.0.0 but none was installed.

My angular version is 5.1, any idea?

meronbrouwer commented 6 years ago

The npm warning can be ignored. It is only a warning and not an error.

Strange that it doesn't work in you situation. I have been using 0.9 in my Angular project, which i keep up-to-date.
You can have a look here at how I use it: (https://github.com/gurpsdomain/GurpsyMcGurpsFace/tree/master/src/app/presentation/dialoges/template-updaters/portrait-updater)

This project seems rather dead and hasn't been updated in a long while. Maybe someone will make a fork soon.

Moppet12 commented 6 years ago

I had "0.9.0" ng2-img-cropper version in my package.json, changed to "^0.9.0" and run npm update and that made the magic!

As you said, the warning can be ignored, thank you! Hope this be useful for someone further.

web-dave commented 6 years ago

this repo is deprecated. But this comp will be maintained by me at https://github.com/web-dave/ngx-img-cropper