Skip to content

varlock-wrangler logs repeated no-op env reloads on macOS #845

Description

@PrinceD96

Description

varlock-wrangler dev can repeatedly print no-op env reload messages on macOS even when no env source file contents appear to have changed:

[varlock-wrangler] change detected in 1 env source file; reloaded env, no changes found, skipping restart.

The behavior is functionally safe because the worker is not restarted, but the repeated log line makes local dev look unstable or like some process is rewriting env files.

Steps to Reproduce

  1. Run a Cloudflare Worker dev command through varlock-wrangler dev.
  2. Leave the dev server running without editing env files.
  3. Observe repeated no-op reload logs.
  4. In another shell, watch the env files directly:
node -e 'for (const f of [".env.schema", ".env.development"]) require("node:fs").watch(f, (event) => console.log(new Date().toISOString(), event, f))'

Observed output from that watcher:

2026-06-26T19:48:10.045Z change .env.schema

But checking the file metadata showed .env.schema was not actually rewritten or touched in the meaningful sense:

Jun 25 22:50:35 2026 1782442235 831 .env.schema

Expected Behavior

No-op watcher events should be quiet by default, or repeated no-op messages should be suppressed/coalesced. A debug-only log behind VARLOCK_DEBUG would be fine.

Actual Behavior

varlock-wrangler dev prints the no-op reload message repeatedly, e.g. four times while the project was idle:

[varlock-wrangler] change detected in 1 env source file; reloaded env, no changes found, skipping restart.
[varlock-wrangler] change detected in 1 env source file; reloaded env, no changes found, skipping restart.
[varlock-wrangler] change detected in 1 env source file; reloaded env, no changes found, skipping restart.
[varlock-wrangler] change detected in 1 env source file; reloaded env, no changes found, skipping restart.

Environment

  • OS: macOS 26.5.1
  • Node: v24.18.0
  • varlock: 1.8.0
  • @varlock/cloudflare-integration: 1.2.0
  • wrangler: 4.104.0

Additional Context

The current varlock-wrangler source already accounts for this functionally by debouncing, reloading the graph, and skipping the restart when the serialized graph is unchanged. The inline comment also mentions macOS fs.watch() extra events for unchanged files. The issue is only that these expected no-op events are noisy in normal dev output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions