-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense type inference stop working after git clone #1133
Comments
I cannot reproduce this. Can you push the code to a github repo so I can look into it? |
I just added you to my private project repo so you can have a look, there is not so much sensible work done anyway. https://github.com/mqdev/gestor-cursos/invitations Basically, if I create a new vue project from zero and simply copy all the files, it works. As soon as I make a PR and merge two branches, and so I need to check out the other branch the problem begins. The |
Actually all of them... I'm making a test, I was using a Windows 10 on the last screens. |
Sorry for the late answer... I was traveling for a course and did not have time to look at this. I'm working on the branch 'alunos' and the same happens in the entire project. If I create a new project everything works fine. I did an experiment:
|
Again, I just checked the App.vue file in this repo. It's working ok. Now, you can try this:
This one and the others are not working... It doesn't show any type of intellisense or autocompletes |
Try adding a import Vue from 'vue'
declare module "vue/types/options" {
interface ComponentOptions<V extends Vue> {
firebase?: {}
}
} See https://vuejs.org/v2/guide/typescript.html#Augmenting-Types-for-Use-with-Plugins for official doc. Although you are not using TS directly, Vetur still depends on the types exported from Vue to work properly. Custom options are not handled gracefully yet, so you need to write these types for apollo/firebase/etc that add custom options to |
Well, I did. Still the same. It's not only about the custom options for the components. But for the entire file. When I type I really don't get the real reason why this is happening. Even if I try to use JSDoc to manually set the types, if I go for |
Actually, I made a change in the code you said and now it's working.
Seems like the lack of definition on the firebase option in the Vue instance is breaking the intellisense, not only for the data from inside this option but for the entire component. Thanks for the help man! |
But that's included in vuefire: https://github.com/vuejs/vuefire/blob/45ebeda19541c16f8897b62c1f277020b0639021/packages/vuefire/types/vue.d.ts#L46-L51. Not sure why it's not resolved automatically. At least for vuex they are. OK
/cc @posva. You can do the same thing as vuex is doing: https://github.com/vuejs/vuex/blob/3f87e0ad9dd82eeaa757b59b79f5ed3011008f92/package.json#L9-L15 |
thanks for the ping! The latest version of vuefire and vuexfire are still under the |
The types are there, but they are not really working. I'm refactored my entire code to use Typescript and changed the database architecture to Firestore and I have the same when I try to make a class from the data retrieved from firestore. Seems like the type definitions are not that complete yet. |
@MQDev You might be running into vuejs/vue#9873 |
I got the following, even if I code in js, it's been required to have the typescript type definitions for all unknown modules or new ones that I write. Perhaps it's something with TS itself, cause as I refactor my code to TS I constantly find inconsistencies in packed type definitions in modules that I was using when I was coding only js. And then, as soon I typed anything inside a vue file that have 1 only inconsistency that in TS would generate an error, it just breaks the functioning of vetur. |
I still have access to your repo. Mind showing a gif and repro steps? |
Info
Problem
The type inference work well when creating a new project. But after I commit and push, and later clone the type inference between the parts of the component stop working and set everything to any.
Both shots were taken at same time.
Reproducible Case
Create a new project with vue cli create command.
Create a simple component or use the Helloworld one to check that the type inference is working.
Init a repo commit and push to github
Delete it from the computer
Clone the repo
Check that the type inference that was working before it's not working anymore.
The text was updated successfully, but these errors were encountered: