remix-run/remix · info

${message}

Error message

${message}

What it means

The node HMR runtime's invalidate() logs the provided message via console.warn when the module is already in the middle of an update (isUpdating). The invalidation is recorded and applied after the current update completes rather than immediately requesting a restart.

Source

Thrown at packages/node-hmr/src/lib/runtime.ts:148

          )
        },
        deps: normalizedDeps,
      })
      return
    }

    this.#acceptCallbacks.push(deps ?? (() => {}))
  }

  dispose(callback: DisposeCallback) {
    this.#disposeCallbacks.push(callback)
  }

  invalidate(message?: string) {
    this.#invalidated = true
    this.#invalidationMessage = message
    if (this.#isUpdating) {
      if (message !== undefined) console.warn(message)
      return
    }
    requestRestart(message)
  }

  on(_event: string, _callback: (data: unknown) => void | Promise<void>) {
    void _event
    void _callback
  }

  async disposeAll() {
    for (let callback of this.#disposeCallbacks) {
      await callback(this.data)
    }
  }

  async update(timestamp: number, acceptedUrl: string): Promise<HotUpdateResult> {
    this.#invalidated = false

View on GitHub (pinned to 9696913134)

Solutions

  1. No action needed if the message is your own invalidation reason
  2. Move invalidate() calls out of in-flight update callbacks if the warning is noisy
  3. Debounce or conditionally invalidate to avoid repeated cascades

Example fix

// before
import.meta.hot.dispose(() => import.meta.hot.invalidate('from dispose'))
// after
import.meta.hot.dispose(() => cleanup())
if (needsRestart) import.meta.hot.invalidate('config changed')
Defensive patterns

Strategy: validation

Validate before calling

if (!import.meta.hot.isUpdating) import.meta.hot.invalidate('reason')

Prevention

When it happens

Trigger: Calling import.meta.hot.invalidate(message) on a module runtime that is currently applying an update (e.g. from within an update-accepting callback that triggers another invalidation).

Common situations: Nested or cascading invalidations during HMR in Remix node apps; invalidate called inside a dispose or accept handler while an update is in flight.

Related errors


AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27). Data as JSON: /api/errors/850222f75e575de3. Report an issue: GitHub.