In my specific case, I believe the error I am encountering may have a different root cause than the common solutions found for it. Configuration-related issues could be at play.
Here is the code snippet:
export default {
data() {
return {
asyncDataStatus_ready: false,
};
},
methods: {
asyncDataStatus_fetched():any {
this.asyncDataStatus_ready = true;
this.$emit('ready');
},
},
};
The errors that arise are:
Property 'asyncDataStatus_ready' does not exist on type '{ asyncDataStatus_fetched(): any; }'. Did you mean 'asyncDataStatus_fetched'?ts(2551)
and
Property '$emit' does not exist on type '{ asyncDataStatus_fetched(): any; }'.ts(2339)
It appears that Typescript mistakenly identifies these as properties of asyncDataStatus_fetched, when they are not. My suspicion is that it could be related to the use of 'this', but I am unsure of alternative approaches to resolve this issue. Perhaps there is a different method for methods to access data in a .ts file compared to a .vue file.