Next.js Discord

Discord Forum

slug is 'undefined' for '/' route in localhost but 'index' in production

Unanswered
Raja posted this in #help-forum
Open in Discord
app/[[...slug]]/layout
export default function Layout({ children, params }) {
    // params.slug[0] is undefined for / route in localhost
        // but same is 'index' for / route in production
}

this was not case until I added supabase authentication.

Can anyone please help me understand what caused this issue and if this is a bug or not?

Thank you.

0 Replies