-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Enhance experience for developing static site #7336
Comments
Hi, you could add this feedback in our RFC for rendering in Next.js. Closing in favor of that. |
This was referenced Jul 28, 2021
This was referenced Aug 31, 2021
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Feature request
Create an environment variable to always remove the req and res object inside ctx.
Is your feature request related to a problem? Please describe.
Next.js is great for building SSR site. But Next.js is great for building static site with export command.
The export command works after build.
The building process could be slow and that is production build which is hard to debug.
When we do export, the req and res are disappeared (Which is true for static web).
When we are development static site, we normally use next dev, and the ctx comes with req and res. If I mistakenly used them, export command would throw error.
Describe the solution you'd like
So what I propose is an environment flag or something inside next.config.js to enforce removal of req and res of ctx object to prevent mistake when building static site. It could be also a "switch" from SSR to Static mode, or vice versa.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: