Watching too many files can hurt performance, and impacts how much work Turbopack is doing. See for example the conversation around https://github.com/vercel/next.js/pull/94597. This PR handles the following four cases: - Git worktrees: we can include a guard to prevent exiting a worktree (by looking at the `.git` file). - Git repository boundaries: we can include a guard to prevent us from exiting a checked-out repository and watching the repository’s parent directory. - We will log a warning if this happens. - Empty / bogus `package.lock` files & `package-lock.json` files (and equivalents using other package managers): if we spot a `package-lock.json` file but it has no packages or a `package-lock.json` w/o an associated `package.json` file. We can ignore them. This handles the case of accidentally running `npm install` in any directory. - Home directory detection: we can detect if we’re going to start watching your home dir and rollback up if this is the case. - We will log a warning if this happens. - If your Next config is in your home dir, we will still run your app there as Next config is the furthest we can rollback - NPM, Yarn, Lerna & Bun workspaces: based on the `workspaces` field in the `package.json` or `lerna.json` I would recommend using split-view to review. I also cleaned up the `warnDuplicatedLockFiles()` function because it was a bit unnecessary to repeat the full message. Closes https://github.com/vercel/next.js/issues/92978
Getting Started
Used by some of the world's largest companies, Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful Rust-based JavaScript tooling for the fastest builds.
- Visit our Learn Next.js course to get started with Next.js.
- Visit the Next.js Showcase to see more sites built with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Community
The Next.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
To chat with other community members you can join the Next.js Discord server.
Do note that our Code of Conduct applies to all Next.js community channels. Users are highly encouraged to read and adhere to it to avoid repercussions.
Contributing
Contributions to Next.js are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing to Next.js.
Good First Issues:
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.
Security
If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and NOT open a public issue.
To participate in our Open Source Software Bug Bounty program, please email [email protected]. We will add you to the program and provide further instructions for submitting your report.