not usable with vue cli setup typescript project
See original GitHub issueI setup a new vue project using the cli, including TypeScript support and wanted to add vuejs-logger. I’m already using the latest version, which includes the type def (.d.ts) file. That file is recognised by VSCode, too.
However I can’t get the project to compile.
this is the main.ts:
import Vue from 'vue';
import VueLogger from 'vuejs-logger';
import App from './App.vue';
import router from './router';
import store from './store';
Vue.config.productionTip = false;
const isProduction = process.env.NODE_ENV === 'production';
const options = {
isEnabled: true,
logLevel : isProduction ? 'error' : 'debug',
stringifyArguments : false,
showLogLevel : true,
showMethodName : true,
separator: '|',
showConsoleColors: true
};
Vue.use(VueLogger, options);
new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#app');
Complete error output:
No overload matches this call.
Overload 1 of 2, '(plugin: PluginObject<{ isEnabled: boolean; logLevel: string; stringifyArguments: boolean; showLogLevel: boolean; showMethodName: boolean; separator: string; showConsoleColors: boolean; }> | PluginFunction<...>, options?: { ...; } | undefined): VueConstructor<...>', gave the following error.
Argument of type 'typeof import("........../node_modules/vuejs-logger/dist/index")' is not assignable to parameter of type 'PluginObject<{ isEnabled: boolean; logLevel: string; stringifyArguments: boolean; showLogLevel: boolean; showMethodName: boolean; separator: string; showConsoleColors: boolean; }> | PluginFunction<...>'.
Property 'install' is missing in type 'typeof import("........../node_modules/vuejs-logger/dist/index")' but required in type 'PluginObject<{ isEnabled: boolean; logLevel: string; stringifyArguments: boolean; showLogLevel: boolean; showMethodName: boolean; separator: string; showConsoleColors: boolean; }>'.
Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue>', gave the following error.
Argument of type 'typeof import("........../node_modules/vuejs-logger/dist/index")' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
Property 'install' is missing in type 'typeof import("........../node_modules/vuejs-logger/dist/index")' but required in type 'PluginObject<any>'.
};
Any suggestions?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using Vue with TypeScript - Vue.js
With a Vite-based setup, the dev server and the bundler are transpilation-only and do not perform any type-checking. This ensures the Vite dev...
Read more >How to use Vue 3 with TypeScript - LogRocket Blog
Vue is flexible, so users are not forced to use TypeScript. ... First, we'll set up a new Vue project with TypeScript using...
Read more >Creating a Vue 3 and TypeScript project using the Vue CLI
As we're going to install this globally, you will only have to perform this once. In the terminal, run the following command: npm...
Read more >Your first Vue 3 app using TypeScript - This Dot Labs
The warnings and errors show that TypeScript is not able to digest the HelloWorld Component that's written in the old TypeScript syntax for...
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
I personally still have the error with 1.5.5
I also have the same issue on 1.5.4 & 1.5.5.