Skip to content

Conversation

@icyJoseph
Copy link
Collaborator

Co-authored-by: joseph.chamochumbi <joseph.chamochumbi@vercel.com>
@cursor
Copy link

cursor bot commented Dec 4, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Dec 4, 2025
| [`.env.development`](/docs/app/guides/environment-variables) | Development environment variables |
| [`eslint.config.mjs`](/docs/app/api-reference/config/eslint) | Configuration file for ESLint |
| `.gitignore` | Git files and folders to ignore |
| `next-env.d.ts` | TypeScript declaration file for Next.js |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env* files should also not be tracked

@hernan-yadiel
Copy link

Hey, I just came across this PR because I was wondering if this file should be tracked by version control. I ultimately decided to track it because I saw this 4 years old comment in a GH issue by one Next.js core team member: #26533 (comment)

Can you please explain me why it shouldn't be tracked? Its content almost never changes, so it seems reasonable, for me, to track it.

@icyJoseph
Copy link
Collaborator Author

icyJoseph commented Dec 4, 2025

@hernan-yadiel - #39051

It is a recommendation after all, but do consider that, Next.js can publish and update type signatures on that file. For example with the introduction of https://nextjs.org/docs/app/api-reference/config/next-config-js/isolatedDevBuild, or route props helpers, etc.

A file named next-env.d.ts will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. You cannot remove it or edit it as it can change at any time. As such this file should not be committed and should be ignored by version control.

@icyJoseph icyJoseph marked this pull request as ready for review December 5, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants