supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Using "Database = unknown". warning

Open jlemonz opened this issue 3 months ago • 9 comments

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.

jlemonz avatar Oct 09 '25 14:10 jlemonz

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".

alex-apostrophy avatar Oct 10 '25 03:10 alex-apostrophy

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?

larbish avatar Oct 10 '25 14:10 larbish

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

alex-apostrophy avatar Oct 10 '25 14:10 alex-apostrophy

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?

i never did stuff with it. I just install the plugin.

jlemonz avatar Oct 10 '25 16:10 jlemonz

So what can i do about this? After every hmr i get the warning.

jlemonz avatar Oct 11 '25 17:10 jlemonz

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:

  1. Open your project on Supabase.com
  2. Go to "API Docs"
  3. Under "Tables and Views" click on "Introduction"
  4. Then in the "Generating Types" section click on "Generate and download types" button along the right.
  5. 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.

Smart-Ace-Designs avatar Oct 11 '25 18:10 Smart-Ace-Designs

aha thanks! i understand it now. i just set types to false. I dont use typescript. Thanks

jlemonz avatar Oct 12 '25 07:10 jlemonz

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

Shooteger avatar Oct 13 '25 17:10 Shooteger

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.

github-actions[bot] avatar Dec 12 '25 18:12 github-actions[bot]