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

Webpack hot reloading stops working if projects is located in a folder starting with ".git" #75372

Open
lorissikora opened this issue Jan 27, 2025 · 1 comment
Labels
Webpack Related to Webpack with Next.js.

Comments

@lorissikora
Copy link

lorissikora commented Jan 27, 2025

Link to the code that reproduces this issue

Simply create a new project (see instructions below)

To Reproduce

  1. Create or navigate to a folder starting with .git (example .git-projects)
  2. Create a new project inside of it (example npx create-next-app@canary and select defaults)
  3. next dev (without --turbo)
  4. Open example page in browser
  5. Change src/app/page.tsx
  6. 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.

@github-actions github-actions bot added the Webpack Related to Webpack with Next.js. label Jan 27, 2025
@samcx
Copy link
Member

samcx commented Feb 7, 2025

@lorissikora Thank you for submitting an issue!

Curious: is there a reason why you would need a project inside the .git directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Webpack Related to Webpack with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants