Using "Database = unknown". warning
Database types configured at "~/types/database.types.ts" but file not found at "C:/eventbird-events/lemonz-v2/app/types/database.types.ts". Using "Database = unknown". I get this warning since i updated to nuxt 4.13 and using supabase v2.
Same for me
Database types configured at "./shared/types/database.types.ts" but file not found at "/Users/al/project/node_modules/@nuxtjs/supabase/dist/shared/types/database.types.ts". Using "Database = unknown".
We did not change anything about this behaviour, we just had a warning so it means the module is now identifying that your types are not loaded. Is your database.types.ts file located at the good place?
Hi @larbish
Docs: default location = ./types/database.types.ts therefore nuxt.config.ts > types: './shared/types/database.types.ts'
Getting the above warning since nuxt v4.1.3 and @nuxtjs/supabase v2.0.1
Given that nothing changed, I just tried types: '../shared/types/database.types.ts' and no longer get the warning.
So not sure what happened.
Cheers Alex
We did not change anything about this behaviour, we just had a warning so it means the module is now identifying that your types are not loaded. Is your
database.types.tsfile located at the good place?
i never did stuff with it. I just install the plugin.
So what can i do about this? After every hmr i get the warning.
So what can i do about this? After every hmr i get the warning.
I think you can generate the types file based on your database using the Supabase CLI: https://supabase.nuxtjs.org/getting-started/introduction#types
Or you can do this from the Supabase admin console as well, for your project:
- Open your project on Supabase.com
- Go to "API Docs"
- Under "Tables and Views" click on "Introduction"
- Then in the "Generating Types" section click on "Generate and download types" button along the right.
- Then place that file in the appropriate location in your project.
In my case I was using Nuxt 4 standard of "shared/types" - which was causing the problem. From looking at Alex's comment above, it appears that it can be fixed by updating nuxt.config.ts to use shared/types:
supabase: { types: "../shared/types/database.types.ts", },
Or, just follow the default location of using "app/types" as mentioned in the error.
But whatever you decide, you have to generate that types file first... Hope that helps.
aha thanks! i understand it now. i just set types to false. I dont use typescript. Thanks
If anyone wants to disable types check fully and remove the warning, write following in your nuxt.config:
supabase: {
types: false
}
otherwise the other comments are correct, you can customize your types path like this:
supabase: {
types: "../shared/types/database.types.ts",
}
The default Nuxt 4 types path is at app/types/database.types.ts
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.