website icon indicating copy to clipboard operation
website copied to clipboard

🐛 Bug: Using query inside getStaticProps DOES NOT WORK

Open vishwansh01 opened this issue 1 month ago • 1 comments

Describe the bug

At /pages/blog/index.page.tsx ,Static generation never receives query params.query will always be { }, no matter what the user selects. So filterTag is always 'All'. Dynamic filtering works ONLY on the client. getStaticProps does not receive query params. Query parameters are only available on the client via useRouter.

Steps To Reproduce

  1. Go to pages/blog/index.page.tsx
  2. See that it do not receives any query (by logging query on server)

Expected Behavior

  • We need to remove the server-side query handling entirely and do all filtering in the browser.
  • Removing filterTag from props entirely (filterTag was not changing anyway)
  • Using a useState/constant value in StaticMarkdownPage for filterTag (It will be initialized to 'All')

Screenshots

Image Image

Device Information [optional]

- OS:Windows
- Browser: Chrome
- version:142.0.7444.60

Are you working on this issue?

Yes

Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)

No

vishwansh01 avatar Nov 17 '25 10:11 vishwansh01

Hi @Utkarsh-123github Can I work on this issue ?

vishwansh01 avatar Nov 17 '25 10:11 vishwansh01