Skip to content

🐛 Bug: Using query inside getStaticProps DOES NOT WORK #1927

@vishwansh01

Description

@vishwansh01

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is the initial status for an issue that requires triage.🐛 BugIndicates that the issue is a bug or defect.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions