Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

@types/croppie has no default export #3

Closed
sshgun opened this issue Mar 5, 2018 · 4 comments
Closed

@types/croppie has no default export #3

sshgun opened this issue Mar 5, 2018 · 4 comments

Comments

@sshgun
Copy link

sshgun commented Mar 5, 2018

ERROR in node_modules/angular-croppie-module/croppie.directive.d.ts(2,8): error
TS1192: Module '"C:/Users/-/angular/node_modules/@types/croppie/index"' has no default export.

Hi, i get the above error when i try to compile mi app, I do not know why it is the error. I new in angular5 and typescript, Could you explain me why it's caused?

@Timebutt
Copy link

Timebutt commented Mar 25, 2018

In croppie.component.ts do the import as import * as Croppie from 'croppie';. The croppie type has been modified since the example in this repo was published. CroppieOptions will have to be written as Croppie.CroppieOptions following said import. Hope this helps!

@Timebutt
Copy link

Timebutt commented Mar 25, 2018

Ah no sorry, that doesn't fix the problem at hand, my bad :(
I'm also getting the error you are showing, I'm looking into what's wrong with the Croppie Typescript definition file.

@Timebutt
Copy link

Ok, found what's going on.
If you use this Typescript definition file, you're good to go with the code as provided in this repository.

It all has something to do with the way they export the Croppie class in the definition file. This comment explains in more detail what's going on if you're interested.

To solve your problem easily, simply force npm to use the typing version that corresponds with the link I provided earlier. Run this and you're set:

npm install --save @types/croppie@2.5.1

@mina-skunk
Copy link
Owner

Sorry all for the late response. Version 0.0.6 should resolve all croppie import issues, and follow the Angular Package Format. Please open a new issue if there are any more problems.

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