In Visual Studio Code, I have the following code:
<script lang="ts" setup>
const parseCSV = () => {
// Code omitted for brevity
}
}
</script>
<template>
<button @click="parseCSV">Parse</button>
</template>
The IDE shows me a squiggly line under parseCSV
. The message shown is:
Property ‘parseCSV’ does not exist on type ‘{}’.ts(2339)
What is the reason?
Restarting the extension “Vue – Official” helped me solve this problem.
I did it like so:
- Open Extensions View: You can open the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X.
- Find the Vue Official Extension: Type “Vue Official” into the search bar in the Extensions view.
- Disable and Re-enable: Click on Disable to temporarily turn off the extension. Then, click on Enable to restart it.