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?
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?

