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

Docs: getServerSideProps redirect object missing basePath #32548

Closed
offgriddev opened this issue Dec 15, 2021 · 1 comment · Fixed by #32550
Closed

Docs: getServerSideProps redirect object missing basePath #32548

offgriddev opened this issue Dec 15, 2021 · 1 comment · Fixed by #32550
Labels
Documentation Related to Next.js' official documentation.

Comments

@offgriddev
Copy link

What is the improvement or update you wish to see?

All of the properties of the server-side redirects should be explained. Currently, the documentation only states that there are { destination: string, permanent: boolean } when it speaks of the shape of the object.
image

However, upon digging, I discovered that there is a basePath property when the server processes redirects here, unless I'm wrong in my reading of your code. If this is true though, that the redirect object in getServerSideProps has a basePath, could we please get the documentation updated to reflect this? It would be nice to see a breakdown of the properties with any additional context like we do in the next.config docs: https://nextjs.org/docs/api-reference/next.config.js/redirects

Is there any context that might help us understand?

When working on PR #352 in the gladly-team/next-firebase-auth repo, I was asked a question from the maintainer about support for SSR redirects for destinations that are outside the base path of the app. He mentioned that the documentation in the area isn't clear, so I dug into the next repo and discovered the actual behavior is through an undocumented basePath property: 59f7676/packages/next/server/base-server.ts#L1899

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering

@offgriddev offgriddev added the Documentation Related to Next.js' official documentation. label Dec 15, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants