advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

Module '"vue-advanced-cropper"' has no exported member 'TransformableImage'.ts(2305) #194

Closed artemaminov closed 2 years ago

artemaminov commented 2 years ago

Module '"vue-advanced-cropper"' has no exported member 'TransformableImage'

<script setup lang="ts">
import debounce from "debounce";
import { TransformableImage } from "vue-advanced-cropper";
...

Or 'default' is not exported by node_modules/vue-advanced-cropper/dist/index.esm-bundler.js if

<script setup lang="ts">
import debounce from "debounce";
import TransformableImage from "vue-advanced-cropper";
...
Norserium commented 2 years ago

@artemaminov, what's version of vue-advanced-cropper do you use?

artemaminov commented 2 years ago

"vue-advanced-cropper": "^2.8.1",

artemaminov commented 2 years ago

I'm new to TS and JS and did fixed that issue creating vue-advanced-cropper.d.ts file and included it from tsconfig.json

import { TransformableImage } from "vue-advanced-cropper";
module 'vue-advanced-cropper' {
  export declare const TransformableImage;
}

Is it correct?

Norserium commented 2 years ago

@artemaminov, actually you have found the bug in the typings.

Try to remove this fragment:

module 'vue-advanced-cropper' {
  export declare const TransformableImage;
}

And update to 2.8.2.

artemaminov commented 2 years ago

It's pass now. Thank you for the great work and lightning fast respond!

Norserium commented 2 years ago

@artemaminov, you are welcome!