Error: [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function in typescripts
See original GitHub issueHello,
I’m having trouble using your library to implement some functions in typescript
. Is showing me the message
"Error: [vue-composition-api] must call Vue.use (VueCompositionAPI) before using any function."
I leave below the error output. I will appreciate your help and your prompt response.!!
import {ref, reactive, UnwrapRef, Ref } from 'vue-demi';
export function fxReactive<T extends object>(obj: T): UnwrapRef<T> {
return reactive(obj);
}
const fx = fxReactive({
data: []
});
console.log(fx.data);
devDependecies
"@vue/composition-api": "^1.0.0-beta.1",
"vue": "^2.6.11"
dependecies
"vue-demi": "latest"
error
C:\Users\c\Desktop\reactivefx\node_modules\@vue\composition-api\dist\vue-composition-api.common.js:43
throw new Error("[vue-composition-api] " + msg);
^
Error: [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function.
at assert (C:\Users\c\Desktop\reactivefx\node_modules\@vue\composition-api\dist\vue-composition-api.common.js:43:15)
at getVueConstructor (C:\Users\c\Desktop\reactivefx\node_modules\@vue\composition-api\dist\vue-composition-api.common.js:83:9)
at observe (C:\Users\c\Desktop\reactivefx\node_modules\@vue\composition-api\dist\vue-composition-api.common.js:470:15)
at Function.reactive (C:\Users\c\Desktop\reactivefx\node_modules\@vue\composition-api\dist\vue-composition-api.common.js:595:20)
at fxReactive (C:\Users\c\Desktop\reactivefx\src\index.ts:6:10)
at Object.<anonymous> (C:\Users\c\Desktop\reactivefx\src\index.ts:9:12)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Module.m._compile (C:\Users\c\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:473:23)
at Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Object.require.extensions.<computed> [as .ts] (C:\Users\c\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:476:12)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Uncaught Error: [vue-composition-api] must call Vue.use ...
This problem was fixed by a friend on the Vue.js forum. For anyone else who is running into this issue I'll post his...
Read more >【Bug】 Uncaught Error: [vue-composition-api] must call Vue ...
I must reopen this issue, and I am referring to #621. ... must call Vue.use(VueCompositionAPI) before using any function #895.
Read more >Uncaught Error: [vue-composition-api] must call Vue.use ...
Coding example for the question Uncaught Error: [vue-composition-api] must call Vue.use(plugin) before using any function-Vue.js.
Read more >TypeScript with Composition API - Vue.js
You can use either type-based declaration OR runtime declaration, but you cannot use ... The type argument should be a type literal with...
Read more >Composition API | FeathersVuex
... data(): "Error: [vue-composition-api] must call Vue.use(plugin) before using any function. ... The next few sections show various TypeScript interfaces, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Planned to make one but didn’t get time to do so. You might want to check the simple demo in the
examples
for now.@antfu ,
Any starter template that you recommend?