You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the .env file exists or you don't use the --watch flag, script runs normally without throwing errors.
How often does it reproduce? Is there a required condition?
These need to be true for the problem to occur:
use the flag --env-file-if-exists pointing to a non existing .env file, like --env-file-if-exists=.env
use the flag --watch
What is the expected behavior? Why is that the expected behavior?
Script should run normally with the following message being printed right before it:
.env not found. Continuing without it.
What do you see instead?
An error stating .env was not found.
.env not found. Continuing without it.
node:internal/fs/watchers:247
const error = new UVException({
^
Error: ENOENT: no such file or directory, watch '/home/mkvlrn/sandbox/repro/.env'
at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
at watch (node:fs:2550:36)
at FilesWatcher.watchPath (node:internal/watch_mode/files_watcher:109:21)
at FilesWatcher.filterFile (node:internal/watch_mode/files_watcher:128:12)
at start (node:internal/main/watch_mode:78:13)
at init (node:internal/main/watch_mode:148:15)
at node:internal/main/watch_mode:160:1 {
errno: -2,
syscall: 'watch',
code: 'ENOENT',
path: '/home/mkvlrn/sandbox/repro/.env',
filename: '/home/mkvlrn/sandbox/repro/.env'
}
Node.js v22.14.0
.env not found. Continuing without it.
repro
node:events:496
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at target._send (node:internal/child_process:877:20)
at target.send (node:internal/child_process:751:19)
at reportModuleToWatchMode (node:internal/modules/cjs/loader:279:13)
at Function._load (node:internal/modules/cjs/loader:1097:5)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49
Emitted 'error' event on process instance at:
at node:internal/child_process:881:39
at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
Node.js v22.14.0
Additional information
This is almost a 100% copy of a previous issue (#56887) I had opened a couple weeks back, but that issue was found on the latest/23 version, while not present in the then current LTS v22.13.1. Now it is happening in the LTS 22.14 version. Still working fine in 22.13.1.
22.13.1
22.14
The text was updated successfully, but these errors were encountered:
Version
v22.14.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Run any script in a project where a .env file doesn't exist:
If the .env file exists or you don't use the
--watch
flag, script runs normally without throwing errors.How often does it reproduce? Is there a required condition?
These need to be true for the problem to occur:
--env-file-if-exists
pointing to a non existing .env file, like--env-file-if-exists=.env
--watch
What is the expected behavior? Why is that the expected behavior?
Script should run normally with the following message being printed right before it:
What do you see instead?
An error stating .env was not found.
Additional information
This is almost a 100% copy of a previous issue (#56887) I had opened a couple weeks back, but that issue was found on the latest/23 version, while not present in the then current LTS
v22.13.1
. Now it is happening in the LTS22.14
version. Still working fine in22.13.1
.22.13.1

22.14

The text was updated successfully, but these errors were encountered: