fix : corrected misleading NODE_ENV comment in middleware.ts#794
Merged
Priyanshu-byte-coder merged 2 commits intoMay 23, 2026
Conversation
|
@TESTPERSONAL is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
added 2 commits
May 23, 2026 09:30
Closes Priyanshu-byte-coder#774 Replaced the misleading comment in src/middleware.ts that claimed NODE_ENV 'evaluates dynamically at build compilation runtime'. In Next.js, process.env.NODE_ENV is a compile-time constant baked into the bundle - it cannot change at runtime. The new comment accurately explains that the higher rate-limit thresholds only apply during local development (next dev) when NODE_ENV is 'development', and that in production builds the lower limits (60/10) are always used. Impact: Prevents developer confusion about the actual runtime behavior of the rate limiter.
a62e1b6
into
Priyanshu-byte-coder:main
9 checks passed
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #774.
Summary of What Has Been Done:
Replaced the misleading comment in src/middleware.ts that incorrectly described how process.env.NODE_ENV behaves.
Changes Made:
Modified: src/middleware.ts
Old comment claimed: 'evaluates dynamically at build compilation runtime' (contradictory)
New comment explains: In Next.js, process.env.NODE_ENV is a compile-time constant baked into the bundle at build time. The higher limits (5000/1000) only apply when NODE_ENV is 'development' (i.e., during next dev). In production builds, the lower limits (60/10) are always used.
Impact it Made:
Prevents developer confusion about the rate limiter's actual runtime behavior.