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

Enhance experience for developing static site #7336

Closed
raymondsze opened this issue May 15, 2019 · 2 comments
Closed

Enhance experience for developing static site #7336

raymondsze opened this issue May 15, 2019 · 2 comments

Comments

@raymondsze
Copy link

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

@ijjk
Copy link
Member

ijjk commented May 22, 2019

Hi, you could add this feedback in our RFC for rendering in Next.js. Closing in favor of that.

@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 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants