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

Query params getting stripped from index route (Next 13 - App dir) #42697

Closed
1 task done
ben-greenwood opened this issue Nov 9, 2022 · 5 comments · Fixed by #42744
Closed
1 task done

Query params getting stripped from index route (Next 13 - App dir) #42697

ben-greenwood opened this issue Nov 9, 2022 · 5 comments · Fixed by #42744
Assignees
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.

Comments

@ben-greenwood
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
  Node: 18.4.0
  npm: 8.12.1
  Yarn: 1.22.19
  pnpm: N/A
Relevant packages:
  next: 13.0.2
  eslint-config-next: 13.0.2
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

When navigating to my website (example -> https://boilerplate-sandy.vercel.app/?utm_source=test) the url params are stripped from the url. This only happens on the root page and not on any nested routes.

I need the utm_source for campaign tracking, so would really appreciate some help!

Expected Behavior

I'd expect the url params to stay in the url when visiting the page. Note that this is the behaviour on Next 12 apps.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

npx create-next-app@latest --experimental-app

To Reproduce

This behaviour can be replicated by building a new Next 13 app with npx create-next-app@latest --experimental-app

@ben-greenwood ben-greenwood added the bug Issue was opened via the bug report template. label Nov 9, 2022
@ceIia
Copy link

ceIia commented Nov 9, 2022

currently facing the exact same issue.

@timneutkens
Copy link
Member

Thanks for the report! Opened a PR here: #42744

@ceIia
Copy link

ceIia commented Nov 10, 2022

thanks @timneutkens!

ijjk pushed a commit that referenced this issue Nov 10, 2022
Ensures the searchParams do not get removed when the page is static.

Fixes #42697

<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@ijjk
Copy link
Member

ijjk commented Nov 11, 2022

Hi, this has been updated in v13.0.3, please update and give it a try!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants