{"record":{"id":"50201b14d52842fd","repo":"amark/gun","slug":"reactive-for-debugname-already-exists","errorCode":null,"errorMessage":"Reactive for '${debugName}' already exists","messagePattern":"Reactive for '(.+?)' already exists","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/wave.js","lineNumber":279,"sourceCode":"  setters = edide.keep(new Map); // varName => setter:func\n\n  dependees = edide.keep(new Map); // varName => deps:\n\n  setLinks = edide.keep(new Map); // for reactiveGraph, show setters inside reactive/setter:s\n\n  debugging = false; //edide.editorModule?\n\n  depsRequired = new Map; // varName : dependsOn\n\n  inInitCall = false; // TODO use dependsOn? instead\n\n  dependsOn = new Set(); // remove\n\n  initSetter = (name, setter) => {\n    var debugName, err, parent, ref, val;\n    debugName = (ref = setter.type) != null ? ref : name;\n    if ((setters.get(name)) != null) {\n      throw Error(`Reactive for '${debugName}' already exists`);\n    }\n    setters.set(name, setter);\n    if (inInitCall) {\n      throw Error(`can't create reactive setter (for '${debugName}') inside reactive context`);\n    }\n    inInitCall = name;\n    dependsOn.clear(); // TODO clear => new Set\n    try {\n      val = setter(); // TODO: some day add revar and unvar as params; helps with multiple reactives to keep the separated\n    } catch (error) {\n      err = error;\n      inInitCall = false;\n      err.message = `Reactive initialization of '${debugName}' failed: ${err.message}`;\n      throw err;\n    }\n    parent = null;\n    dependsOn.forEach((depName) => {\n      var deps;","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/amark/gun/blob/552227599d47ba0493824b7fcf8a00c8cd6404ba/lib/wave.js#L261-L297","documentation":"Duplicate reactive-setter registration in the EDIDE wave reactive system. initSetter() keeps a Map of variable name -> setter; when a new reactive is initialized under a name that already has a setter, it throws to prevent silently overwriting an existing reactive's update logic. The debugName in the message is the setter's type label (or the variable name).","triggerScenarios":"Thrown at lib/wave.js:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the new reactive so it does not collide with the existing one","Remove or unbind the old reactive for that name before creating a new one","Check app init code for accidental double registration of the same reactive (e.g. hot reload or re-running a setup block)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"552227599d47ba0493824b7fcf8a00c8cd6404ba","analyzedAt":"2026-09-02T18:40:58.370Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}