Webpack hot reloading stops working if projects is located in a folder starting with ".git"
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
Simply create a new project (see instructions below)
To Reproduce
- Create or navigate to a folder starting with
.git(example.git-projects) - Create a new project inside of it (example
npx create-next-app@canaryand select defaults) next dev(without--turbo)- Open example page in browser
- Change
src/app/page.tsx - Observe no change
Current vs. Expected behavior
Current
If the parent folders of a nextjs application start with ".git", the webpack dev server (without --turbo) will not hot reload any changes made to the app.
Example paths of this might be:
/path/to/my/.git-projects/nextjs-app(this is my setup, which is how I found this in the first place)/path/to/my/.git-projects/a/b/c/nextjs-app/path/to/my/.git/nextjs-app
This is not an issue when using Turbopack.
Expected
Hot reloading should work.
I honestly don't expect this to be fixed, but I would love for others, who are facing a similar issue, to find this and spare them of multiple hours of wondering why this isn't working as expected.
Provide environment information
/bin/sh: pnpm: command not found
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
Available memory (MB): 32768
Available CPU cores: 12
Binaries:
Node: 22.9.0
npm: 10.8.3
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 15.2.0-canary.27 // Latest available version is detected (15.2.0-canary.27).
eslint-config-next: 15.2.0-canary.27
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Was tested on @latest and @canary. Ignore the github repo, it is simply the default template of the current canary version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with a Next.js app under a parent folder such as .git-projects, run next dev without --turbo, and edit src/app/page.tsx. Start by tracing the webpack hot-reload path used by next dev and compare it with the working Turbopack behavior. Done means edits to the example page update in the browser when the project is nested under a .git-prefixed path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js, typescript, webpack
- Domain
- developer-experience, frontend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100