question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not usable with vue cli setup typescript project

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jenowcommented, Nov 26, 2020

I personally still have the error with 1.5.5

0reactions
tsposatocommented, Jun 28, 2021

I also have the same issue on 1.5.4 & 1.5.5.

Read more comments on GitHub >

github_iconTop 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 >
New project with Vue 3 and typescript not working ... - GitHub
Re-install the vue-cli?
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found