michaelolof / typescript-mix

A tweaked implementation of TypeScript's default applyMixins(...) idea using ES7 decorators
https://www.npmjs.com/package/typescript-mix
86 stars 8 forks source link

This expression is not callable. #13

Open tom-dr opened 3 years ago

tom-dr commented 3 years ago
ERROR in D:/git/aca-stages/src/components/InternshipsSchedule.vue(994,4):
994:4 This expression is not callable.
  Type 'typeof import("D:/git/aca-stages/node_modules/typescript-mix/dist/index")' has no call signatures.
    992 | })
    993 | export default class InternshipsSchedule extends Vue {
  > 994 |   @use( stepsMixin ) (this as any)
        |    ^
    995 | 
    996 |   dataLevelsIsLoading = false
    997 | 
Version: typescript 3.9.7
Time: 780ms
ktstowell commented 3 years ago

I'm getting the same thing, I have a feeling it's because I'm not importing decorators correctly because I'm using create-react-app and there might be an extra step.

ktstowell commented 3 years ago

So i just dug through the code and it shows exports.use = use; - meaning you will have to import {use} from 'typescript-mix though the documentation doesn't show the named import and treats it as a default.