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.

Using vue-meta in typescript causing vetur to trigger false-positive errors

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.21.0
  • VS Code version: 1.35.1

Problem

Main error:

Object literal may only specify known properties, and 'metaInfo' does not exist in type 'ComponentOptions<{ deviceType: DeviceType; isDesktop: boolean; isTablet: boolean; isMobile: boolean; } & Record<never, any> & Vue, DefaultData<{ deviceType: DeviceType; isDesktop: boolean; isTablet: boolean; isMobile: boolean; } & Record<...> & Vue>, DefaultMethods<...>, DefaultComputed, PropsDefinition<...>, Record...'.Vetur(2345)

and a lot of errors in computed and methods sections like this:

Property '$store' does not exist on type '{ ... }'. Vetur(2339)
...
Property 'deviceType' does not exist on type '{ ... }'.Vetur(2339)

As you can see on this gif we have a lot of false-positive (tsc compiles just fine) errors that disappear after commenting the line with declaring metaInfo option ScreenRecording2019-06-27at2

Reproducible Case

Just try to use vue-meta with typescript Vue components (<script lang="ts">...</script>)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ktsncommented, Aug 20, 2019

Because you are not importing vue-meta in any TS file in your project. You need to add import statement for vue-meta to load its typing.

// Add import statement in your ts.
import 'vue-meta'
0reactions
yekvercommented, Aug 20, 2019

I’ve created a repro here: https://github.com/yekver/ts_vue-meta You can see this bug in src/App.vue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using vue-meta in typescript causing vetur to trigger false ...
Using vue-meta in typescript causing vetur to trigger false-positive errors #1344. yekver posted onGitHub. I have searched through existing issues
Read more >
Nuxt `head` property shows errors when using computed ...
Within this, if I access computed properties, Vetur shows: Property 'domain' does not exist on type 'CombinedVueInstance {...}>'.
Read more >
[Solved]-How do I fix Vetur type error Typescript / Vue-Vue.js
Coding example for the question How do I fix Vetur type error Typescript ... that you already have a real value and not...
Read more >
How To Change Metadata in Vue.js with vue-meta
Learn how to use vue-meta to change the title and meta tags in your Vue.js apps.
Read more >
ESLint plugin for Prettier formatting
(If another active ESLint rule disagrees with prettier about how code should be formatted, it will be impossible to avoid lint errors.) ...
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