© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
8 replies
b3n123

Server Side Dynamic Page

I need to render a dynamic page on the server side using RLS.

I can make both RLS and params work individually however I can't pass both ctx and { params} to the function without getting an error as below.

When trying
export const getServerSideProps = async (ctx, { params }) => {
export const getServerSideProps = async (ctx, { params }) => {

I get the error
Cannot destructure property 'params' of 'undefined' as it is undefined
Cannot destructure property 'params' of 'undefined' as it is undefined


This is probably due to my relatively new learning of Javascript but I'm confused why I can pass ctx or { params } one at a time but not both at the same time.

This is the code I'm trying to extend from to use
params.id
params.id
in the data query

https://supabase.com/docs/guides/auth/auth-helpers/nextjs#server-side-data-fetching-with-rls

Any help would be much appreciated
Supabase Documentation
Supabase Auth with Next.js
Authentication helpers for Next.js API routes, middleware, and SSR.
Supabase Auth with Next.js
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

withPageAuth Dynamic Page
SupabaseSSupabase / help-and-questions
4y ago
Server-side permission
SupabaseSSupabase / help-and-questions
4y ago
Sveltekit Server side authentication
SupabaseSSupabase / help-and-questions
2mo ago
SvelteKit Server Side Authentication
SupabaseSSupabase / help-and-questions
5mo ago