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.

Property '$log' does not exist on type '*'

See original GitHub issue

Hi!

I’m using TypeScript with my Vue 2 project but after adding the vuejs-logger module and bound it to Vue I get the following error:

Property '$log' does not exist on type 'Application'.

That’s the same for all my components… any idea how to solve this please?

Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
ryanleecodecommented, Nov 30, 2018

@sneko solution almost worked for me. Had to change the interface to use the VueConstructor instead.

import Vue from 'vue';

declare module 'vue/types/vue' {
  export interface VueConstructor<V extends Vue = Vue> {
    $log: {
      debug(...args: any[]): void;
      info(...args: any[]): void;
      warn(...args: any[]): void;
      error(...args: any[]): void;
      fatal(...args: any[]): void;
    };
  }
}
4reactions
AlvaroBreycommented, Feb 6, 2019

@justinkames would you consider adding such a .d.ts file in the NPM package, or publishing another package with type definitions? This is needed to properly use vuejs-logger in Typescript projects.

In the meantime we can all work around it by adding the definitions ourselves, but it would be better if we didn’t have to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error TS2339: Property 'log' does not exist on type '{ new ...
To be clear, Console seems to be a constructor function that produced the console object. console instanceof Console; // true Though it doesn't...
Read more >
TS2339: Property 'log' does not exist on type 'Formatter'. #292
error: TS2339: Property 'log' does not exist on type 'Formatter'.
Read more >
Property does not exist on type '{}' in TypeScript | bobbyhadz
The "Property does not exist on type '{}'" error occurs when we try to access or set a property that is not contained...
Read more >
How To Fix The "Property does not exist on type Window ...
A good example of this is the Property does not exist on type 'Window & typeof globalThis' error. The Problem. This error occurs...
Read more >
TS2339: Property does not exist on type : WEB-42908
TS2339 : Property 'index' does not exist on type 'Repository'. But, when I compile with TypeScript, it reports zero errors. Further, if I...
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