-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Version
@nuxtjs/supabase: v2.x (latest 2.x release at time of writing)
nuxt: v4.x
node: v24.x
os: Windows 11
Reproduction Link
No public repository is available.
However, the issue can be reproduced by following the official documentation example for serverSupabaseServiceRole:
https://supabase.nuxtjs.org/services/serversupabaseservicerole
Steps to reproduce
-
Create a fresh Nuxt 4 project:
npx nuxi init my-appcd my-app
-
Install and configure
@nuxtjs/supabasev2.x according to the official setup guide:- Add
@nuxtjs/supabasetomodulesinnuxt.config - Configure the Supabase URL and anon/service role keys as described in the docs.
- Add
-
Implement the example from the documentation page
https://supabase.nuxtjs.org/services/serversupabaseservicerole
Specifically:- Create a server route (e.g.
server/api/test-service-role.get.ts) - Inside that handler, call
serverSupabaseServiceRole()and perform a simple query (for example,selectfrom a test table) exactly as shown in the docs.
- Create a server route (e.g.
-
Run the development server:
npm run dev
-
Call the server endpoint you created (e.g.
GET /api/test-service-role) from a browser or via a tool like curl/Postman. -
Observe the behavior of:
- Server-side functions using
serverSupabaseServiceRole - Client-side Supabase functions (for comparison, you can also implement the basic client-side example from the docs).
- Server-side functions using
What is Expected?
- The
serverSupabaseServiceRole()helper should return a working Supabase client in Nuxt 4 when using@nuxtjs/supabasev2.x. - The server endpoint using
serverSupabaseServiceRoleshould:- Execute queries successfully using the service role key.
- Respond with the queried data (e.g. rows from a table) without errors.
- Client-side and server-side Supabase helpers should both function correctly under the same configuration.
What is actually happening?
- Client-side Supabase functions work as expected (no issues observed when using the standard client helpers in pages/components).
- When using server-side helpers (particularly
serverSupabaseServiceRole) in a server route:- The endpoint fails at runtime.
- The request returns an error response (HTTP 500 / internal server error).
- The failure appears to originate from the server-side Supabase helper provided by the module, not from the user-land query logic itself.
- This problem occurs only when using
@nuxtjs/supabasev2.x with Nuxt 4 and Node 24 on Windows 11. - The documentation example at https://supabase.nuxtjs.org/services/serversupabaseservicerole cannot be run successfully in this environment using v2.x, while client-side functions from the same module and configuration remain functional.
nicokempe and cewald
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working