Skip to content

DF0053: Memoized Instance Replaced

Message

initDevframe("{id}") replaced the live instance memoized under key "{key}": its options changed since the previous call.

Cause

initDevframe was called with a key that already maps to a live instance, but the option fingerprint differs from the memoized one's. Dev servers that re-evaluate modules on the fly (Next.js, Nitro, SvelteKit HMR) re-run initDevframe on every reload; the key memoization normally returns the live instance, but when the options genuinely changed the old instance — including its side-car WebSocket server — is closed and a fresh one starts.

Example

ts
import { initDevframe } from 'devframe/initiate'

// First evaluation:
initDevframe(def, { key: 'devtools', ws: { port: 7811 } })

// A later reload with a different port replaces the live instance:
initDevframe(def, { key: 'devtools', ws: { port: 7812 } }) // ⚠ DF0053

Fix

This is informational when you edited the options on purpose — the replacement is the intended behavior. If it fires without an intentional change, make the options stable across reloads (module-level constants rather than values recomputed per evaluation), or give genuinely different instances distinct keys.

Source

Released under the MIT License.