NuxtN
Nuxt10mo ago
4 replies
MrFluffycloud

ERROR [vite-node] [plugin:vite:vue] [VITE_ERROR]

<script setup>
const route = useRoute();
const { fetchItemById, loading, error } = useItems();
const item = ref(null);

onMounted(async () => {
try {
item.value = await fetchItemById(route.params.id);
} catch (e) {
console.error('Failed to load item:', e);
}
});
</script>

<template>
....
</template>


for some reason route.params.id returns undefined?
image.png
Was this page helpful?