I have this code, Vue 3 + Vite:
<script setup>
import { computed, onMounted } from "vue";
import { useStore } from "vuex";
const store = useStore();
const playlists = computed(() => store.getters["playlists/allPlaylists"]);
const playlistsCount = computed(
() => store.getters["playlists/allPlaylistsCount"]
);
const selectPlaylist = (playlist) => {
store.dispatch("playlists/selectPlaylist", playlist);
}
onMounted(async () => { await store.dispatch('playlists/getAllPlaylists') })
</script>
I'm not using typescript, I use Visual Studio Code.
I get warned by the IDE on the onMounted
method with:
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.ts(2705)
my jsconfig.json
{
"include": [
"./src/**/*"
],
"compilerOptions": {
"checkJs": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
}
}
anything I can do to make the IDE error go away?