Object is of type 'unknown' according to Vetur but TypeScript is able to infer the correct type + vue-cli-service build fails.
See original GitHub issueInfo
- Platform: Windows 10 64bit Pro
- Vetur version: 0.24.0
- VS Code version: 1.44.2
Problem
Vetur is reporting the parameter is of type unknown
even though TypeScript is able to derive the type GetLoggedInUserQuery
.
Edit: Cannot build the app because of this.
Reproducible Case
- Setup
@vue/composition-api
for Vue 2 - Setup
@vue/apollo-composable
- Use the
useResult()
helper of@vue/apollo-composable
on your GraphQL query. - Use the parameter (
data
from the screenshot) of the function from the third argument of theuseResult()
function. - Vetur will report:
Object is of type “unknown”.
Even though TypeScript is able to derive the correct type.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Object is of type 'unknown'.Vetur(2571) when populating a ...
I assume the issue is I need to declare the type in the constant for each of the populate variables. Any ideas how...
Read more >vuejs/vetur (Raised $789.00) - Issuehunt
Object is of type 'unknown' according to Vetur but TypeScript is able to infer the correct type + vue-cli-service build fails.
Read more >[Solved]-How do I fix Vetur type error Typescript / Vue-Vue.js
The error indicates that tableMatch is an array of TableMatchInterface objects. Did you mean something like siteStore.tableMatch[0].slot.
Read more >@vue/cli-plugin-typescript | Yarn - Package Manager
@vue/cli-plugin-typescript. typescript plugin for vue-cli. Uses TypeScript + ts-loader + fork-ts-checker-webpack-plugin for faster off-thread type checking.
Read more >Adding Typescript to your existing VueJS 2.6+ app - Medium
This means you can add Typescript to your project and keep your source files unchanged. Pointless indeed, but it proves the retro-compatibility ...
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
@octref Sure, here
The vue-cli-service isn’t
vetur
problem, but I also study about it.apollo-client
graphql
) in this repos.useGetLoggedInUserQuery
have a type error.@vue/apollo-composable
library have a type error.Maybe third problem is type problem in
@vue/apollo-composable
library, You canskipLibCheck: true
intsconfig.json
for ignore it.I fixed them, and then the project will build success.