Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search params object empty on production (vercel) but not locally #62452

Open
pitops opened this issue Feb 23, 2024 · 0 comments
Open

Search params object empty on production (vercel) but not locally #62452

pitops opened this issue Feb 23, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template.

Comments

@pitops
Copy link

pitops commented Feb 23, 2024

Link to the code that reproduces this issue

https://github.com/pitops/nextjs-search-params-issue

To Reproduce

you have a category/[slug]/page.tsx with the following

interface CategoryPageProps {
    params: {
        slug: string
    }
    searchParams: {
        slug: string
    }
}
const CategoryPage: React.FC<CategoryPageProps> = async ({
                                                             params,
                                                             searchParams
                                                         }) => {
    console.log('params', params)
    console.log('searchParams', searchParams)

    return <div>test</div>
}

export default CategoryPage

I try the following URL: http://localhost:3000/category/test?slug=1

locally -> searchParams { slug: 1 }
vercel -> searchParams {}

Current vs. Expected behavior

search params object should be filled in production as well

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
Binaries:
  Node: 19.6.0
  npm: 9.5.0
  Yarn: 1.18.0
  pnpm: N/A
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 13.5.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

No response

@pitops pitops added the bug Issue was opened via the bug report template. label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant