-
Notifications
You must be signed in to change notification settings - Fork 241
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
Property X does not exist on type '{}'. ts(2339) #148
Comments
Hey, I'd love to take this up. Could you please assign it to me @andrewtavis |
Sounds good, @pujxn. Let me know if you need any assistance :) |
Hello @pujxn I am wondering how you are doing on this! Have already solved it? I have found a few things that could potentially help. If you have solved it I am curious to see what you did! Thank you for your work. 👍 😎 |
Hi @TeddyGavi , so far I've just realised I'm in way over my head. But I have tried explicitly defining the type for the props to 'any' as suggested here - https://stackoverflow.com/questions/34274487/typescript-property-does-not-exist-on-type |
Thanks for your efforts @pujxn, and thanks also for the support @TeddyGavi! 😊 |
Hello @pujxn I too am in over my head! That is how we learn 👍 . I have done some asking around in other dev communities and reading of the docs, I have found a couple things that might be of help. https://nuxt.com/docs/guide/concepts/typescript is the link to Nuxt setup. It defines a As far as I can tell there is nothing telling Nuxt/Vue to use typescript, so attempting to import or declare defineProps becomes undefined...maybe I am out to lunch? I stumbled on this because in So in typescript: {
strict: true,
typeCheck: true,
}, and in "extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"strict": true,
// ...other options
"types": [
// ... lib types in project as needed...
]
}
} And there is always this to look at as an option https://github.com/viandwi24/nuxt3-awesome-starter/tree/main I wonder if @andrewtavis since you mentioned you looked into this previously, have you tried something like this? If yes then we need to try something else. This might be wrong, but these are things I have looked into! I haven't had time to try this yet in the code. Good luck! |
I haven't tried either of these options, @TeddyGavi :) Definitely worth a try 😊 Do both of you want to try these changes to see if they'd work, and if so we can get @pujxn to send along the change? (hope that's ok, @TeddyGavi!) |
No problem @andrewtavis sounds like a great plan! |
Thanks so much, @TeddyGavi ! Let me try this out, seems promising. |
Looking forward to hearing back from you, @pujxn! :) |
Hi @TeddyGavi , so I added the typescript option to nuxt config, and also looked updated tsconfig to match exactly to what https://github.com/fi3ework/vite-plugin-checker/issues/193#issuecomment-1440452881 has. However, we're still facing the same issue. I forked that project, and see that it too shows the same ts2339 errors. I was trying to run the docker image for activist, and it gave me an error stating: ERROR Cannot start nuxt: Cannot find module 'vue-tsc/out/proxy' I then installed it along with typescript using : I found another issue where the suggested fix was to upgrade the version to latest: fi3ework/vite-plugin-checker#193 (comment) But since I'm already on the latest one, I don't see what could be going wrong. This is my first time using Docker, so apologies if I'm missing something obvious |
Hey @pujxn Thats too bad that didn't work out! I got some feedback from another community and could be something else to look into. I'll copy the thread there: (it may be confusing as we both have the same first name! I am Matt, he is the Matthew 😆
And the reply:
So now I am thinking that we need to look carefully at the package.json to make sure we have all the correct deps for TS. Any thoughts @andrewtavis ? |
Great that you're in these communities, @TeddyGavi 😊😊 So looking at nuxt3-awesome-starter a bit more in detail, specifically for TS in their package.json they have Maybe trying some of these installations along with the methods from this comment would work? Thanks to you both for all your efforts! |
Hello @pujxn and @andrewtavis @anthonyshibitov I believe I have the configuration sorted out, at a basic level. I created a thread in matrix recently and have added some of my current findings there. In summary:
yarn add --dev vue-tsc typescript
And 😄 the TS errors (almost all of the error
I had the exact same issue. After a full docker clean with I wonder how we should proceed now. As some components such as Also, I would like to see if @pujxn and others get the same outcome. |
Notes from a call that I had with @TeddyGavi (😊):
|
@TeddyGavi, do you want to send along a minor commit that annotates @anthonyshibitov, it'd also be great to get your feedback on this to let us know if there're any issues on your end still :) I'll close this for now so long as nothing else comes up. Thanks again all for your dedication to the infrastructure and development experience! 🙏 |
Terms
Behavior
Props in templates are returning a "property x does not exist on type '{}'" Typescript error with Volar and Typescript Vue VS plug-ins installed.
Image below:
The text was updated successfully, but these errors were encountered: