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

Issue with getServerSideProps ctx.req.url #44259

Closed
1 task done
yishayhazan opened this issue Dec 22, 2022 · 2 comments
Closed
1 task done

Issue with getServerSideProps ctx.req.url #44259

yishayhazan opened this issue Dec 22, 2022 · 2 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@yishayhazan
Copy link

yishayhazan commented Dec 22, 2022

Verify canary release

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

Provide environment information

Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.3.1
eslint-config-next: 12.3.1
react: 18.2.0
react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

/

To Reproduce

home.js

export const getServerSideProps = (ctx) => {
    console.log(ctx.req.url);
    return { props: {} };
}
export default function Home() {
    return <Link href="/about">about</Link>
}

about.js

export const getServerSideProps = (ctx) => {
    console.log(ctx.req.url);
    return { props: {} };
}
export default function About() {
    return <Link href="/home">home</Link>
}

Describe the Bug

on first load, ctx.req.url works as expected,
but when you start navigating between pages it gets weird.

  • logs: /home
  • click on the link
  • logs: /_next/data/development/about.json

Expected Behavior

  • logs: /home
  • click on the link
  • logs: /about

Which browser are you using? (if relevant)

chrome 108.0.5359.125

How are you deploying your application? (if relevant)

next dev & next start

@yishayhazan yishayhazan added the bug Issue was opened via the bug report template. label Dec 22, 2022
@vercel-release-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@vercel-release-bot vercel-release-bot added the stale The issue has not seen recent activity. label Jan 12, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2025
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. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

3 participants