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

[Bug] QueryString not working in production - window.location.search empty #1660

Closed
VaidotasSm opened this issue Mar 21, 2022 · 0 comments
Closed
Labels
bug 🐛 wontfix 🙅‍♀️ This won't be applied, fixed, worked on, continued.

Comments

@VaidotasSm
Copy link

VaidotasSm commented Mar 21, 2022

Reporting a bug?

Provide as much information as you can to reproduce the issue.
If the issue is not reproducible, it can't be fixed!

Environment

Run and copy the result of:

npx envinfo --system --npmPackages react* --binaries --npmGlobalPackages react* --browsers

here:

npx envinfo --system --npmPackages react* --binaries --npmGlobalPackages react* --browsers
zsh: no matches found: react*


npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers
npx: installed 1 in 1.364s

  System:
    OS: macOS 11.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 3.37 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.0 - ~/.volta/tools/image/node/14.18.0/bin/node
    Yarn: 1.19.0 - ~/.volta/tools/image/yarn/1.19.0/bin/yarn
    npm: 6.14.15 - ~/.volta/tools/image/node/14.18.0/bin/npm
  Browsers:
    Chrome: 99.0.4844.74
    Firefox: 94.0.1
    Safari: 14.1.2
  npmPackages:
    @reach/router: ^1.3.4 => 1.3.4
    @types/node: ^14.17.21 => 14.18.5
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    react-hot-loader: ^4.13.0 => 4.13.0
    react-static: ^7.6.2 => 7.6.2
    react-static-plugin-reach-router: ^7.6.2 => 7.6.2
  npmGlobalPackages:
    npm: 6.14.15

Steps to Reproduce the problem

Base your steps off of any freshly installed react-static template!

  1. I have a page that reads window.location?.search
  2. I navigate to that page with query-string parameter /xxx?invite=test01
  3. On yarn dev or yarn build && yarn serve everything works fine.
  4. On yarn build and deploy to production, /xxx?invite=test01 gets redirected by react-static to /xxx. This happens for all pages and all query-string parameters except index page.

PROD:
Screenshot 2022-03-21 at 18 43 23

DEV:
Screenshot 2022-03-21 at 18 51 18

@SleeplessByte SleeplessByte added the wontfix 🙅‍♀️ This won't be applied, fixed, worked on, continued. label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 wontfix 🙅‍♀️ This won't be applied, fixed, worked on, continued.
Projects
None yet
Development

No branches or pull requests

2 participants