{"record":{"id":"fd0d91b7d3c130e6","repo":"diegosouzapw/OmniRoute","slug":"no-valid-plugin-found-in-sourcedir-errors-ma","errorCode":null,"errorMessage":"No valid plugin found in ${sourceDir}: ${errors.map((e) => e.error).join(\", \")}","messagePattern":"No valid plugin found in (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/plugins/manager.ts","lineNumber":158,"sourceCode":"      const parsed = JSON.parse(raw);\n      const result = safeValidateManifest(parsed);\n      if (result.success) {\n        const entryPoint = join(sourceDir, result.data.main);\n        directPlugin = {\n          name: result.data.name,\n          manifest: result.data,\n          pluginDir: sourceDir,\n          entryPoint,\n        };\n      }\n    } catch {}\n\n    const { plugins, errors } = directPlugin\n      ? { plugins: [directPlugin], errors: [] }\n      : await scanPluginDir(sourceDir);\n\n    if (plugins.length === 0) {\n      throw new Error(\n        `No valid plugin found in ${sourceDir}: ${errors.map((e) => e.error).join(\", \")}`\n      );\n    }\n\n    const discovered = plugins[0];\n    const { name, manifest, pluginDir: srcDir } = discovered;\n\n    // If already installed, auto-upgrade when source is strictly newer; reject otherwise.\n    if (pluginExists(name)) {\n      const existing = getPluginByName(name)!;\n      if (compareSemver(manifest.version, existing.version) > 0) {\n        // Source is newer — delegate to upgrade()\n        return this.upgrade(sourceDir);\n      }\n      throw new Error(\n        `Plugin '${name}' is already installed (${existing.version}) and source version ${manifest.version} is not newer`\n      );\n    }","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/plugins/manager.ts#L140-L176","documentation":"install() scanned sourceDir (direct manifest.json probe then scanPluginDir) and found zero valid plugin manifests; the collected per-candidate errors are joined into the message. Means the source directory holds no installable plugin.","triggerScenarios":"Thrown at src/lib/plugins/manager.ts:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the listed errors for why each manifest failed validation","Add a valid manifest.json with name/version/main to the source dir","Verify you are pointing install() at the plugin root, not a parent folder"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}