Having a folder named ".env" in the root of a project will cause a full reload when any component in the app
directory is opened and saved
#65229
Labels
bug
Issue was opened via the bug report template.
Link to the code that reproduces this issue
https://github.com/michaelcharles/nextjs-reload-bug
To Reproduce
.env
app
app
, say aFoobar.tsx
that just loads a div.vscode/launch.json
file, and run the debuggerFoobar.tsx
and save.After saving a full reload will be performed.
Current vs. Expected behavior
Currently, if you take the steps listed to reproduce and save
Foobar
, even if the component is not loaded anywhere on the page, a full reload will occur refreshing the page in the browser.I expect a fast refresh, a refresh that will not reload the page. Especially since this occurs even if the
Foobar
component is not explicitly used anywhere on the page.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 18.19.0 npm: 10.2.3 Yarn: N/A pnpm: N/A Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: 14.2.3 react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
This occurred because we were storing example .env files in the
.env
folder. I simply have changed to saving example .env files asexample.env.local
and the problem has disappeared. So this isn't exactly a high priority, but it is an odd bug.The text was updated successfully, but these errors were encountered: