nathan1658
Best Practices for Handling Non-Existent API Routes in Nuxt3
Hi everyone, I'm in the process of refactoring my project, during which I updated my existing API under /api. However, there seems to be no error or typing for both $fetch and useFetch, indicating that the API route being called no longer exists. What is the best way to achieve this purpose? Is it possible to get a type error for this? Thank you.
2 replies
Question about tranform with useFetch
I've noticed an inconsistency in how the transform function of useFetch behaves in Nuxt 3. Here's a minimal example to illustrate:
I've observed that:
1. When I refresh the page, the transform function executes on the server-side.
2. When I navigate to this page from another page using Vue Router (e.g., $router.push()), the transform function executes on the client-side.
Is this the expected behavior? If so, what's the rationale behind it? Thank you.
4 replies