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

Problems with Link | href | dynamic "as" | headers: next-url, referer #63423

Open
MrOxMasTer opened this issue Mar 18, 2024 · 1 comment
Open
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@MrOxMasTer
Copy link

MrOxMasTer commented Mar 18, 2024

Link to the code that reproduces this issue

https://github.com/MrOxMasTer/shopco/commit/f7d9e29b086159435e105cabf0521f56f08d8b8e

To Reproduce

  1. Run the application in dev mode (--turbo)
  2. Click on the user's icon to go to the site with authorization
  3. Click on the burger, which opens the menu page
  4. Click on the cross and try to go back

Current vs. Expected behavior

After clicking the cross, return to the page where the user was before

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
Binaries:
  Node: 20.11.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.1.3
  eslint-config-next: 14.1.3
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.2
Next.js Config:
  output: N/A

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

App Router, Routing (next/router, next/navigation, next/link)

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

next dev (local)

Additional context

  1. The first moment. Using the next url. It can be used, but it breaks the site when updating
Desktop.20240318.-.20452302_compressed.mp4
  1. Pathname Usage. Does not go back to the page and on refresh causes an error that is not corrected in any way. Only by restarting dev
Desktop.20240318.-.20463303_compressed.mp4
  1. Applying as, so that the url that is specified in the string would be the url on refresh. There is no transition. When refreshing it breaks the page
Desktop.20240318.-.20481704_compressed.1.mp4
  1. Attempting to apply a full reference which also fails to produce any results
Desktop.20240318.-.20503706_compressed.1.mp4

The problem is that maybe I don't understand how "as" is supposed to work?

I also can't switch to normal dev mode OR update the package because it says that my modal component is not server-side, even though the modal doesn't even have 'use client' in the higher-order components (Like the components inside) (next 14.2.0-canary.28):
image
image
image
image
image

P.S.
Forgot to mention 2 details with js disabled:

next-url always has value = "/" and if used, it always redirects to the home page
pathname (from referer) - works as it should. Normally redirects to the pages from which the user came from the menu.

@MrOxMasTer MrOxMasTer added the bug Issue was opened via the bug report template. label Mar 18, 2024
@github-actions github-actions bot added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Mar 18, 2024
@MrOxMasTer MrOxMasTer changed the title Server Modal. Link | href | as | headers Problems with Link | href | as | headers Mar 19, 2024
@MrOxMasTer MrOxMasTer changed the title Problems with Link | href | as | headers Problems with Link | href | dynamic "as" | headers Mar 19, 2024
@MrOxMasTer MrOxMasTer changed the title Problems with Link | href | dynamic "as" | headers Problems with Link | href | dynamic "as" | headers: next-url, referer Mar 21, 2024
@MrOxMasTer
Copy link
Author

On newer versions this problem occurs:

#64922

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. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

1 participant