TorErik
File is not a module - Typescript
I'm setting up typescript in a Nuxt project for the first time.
I have generated types from my supabase DB according to the docs
https://supabase.com/docs/guides/api/rest/generating-types
But when I do
import { Database } from '~/types/supabase';
I get this error:
"File '/types/supabase.ts' is not a module."
import type { Database } from '~/types/supabase';
does nothing.
Why is this happening?1 replies
Get error code from $fetch
How can I get the error code from $fetch when a request fails?
I need to do call different methods based on the type of error.
I have server route that returns a promise like this, but it only logs the error message and doesn't give any other information:
7 replies
localePath issue
In nuxt 2 I have this code to generate links to a given route name:
According to this:
https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22
params
is now ignored in vue-router:
I have read the docs, but the language is confusing to me. I don't understand how to rewrite it to make it work as intended.
Can someone ELI5 what the recommended approach is?7 replies