{"record":{"id":"f50f2434785b56f4","repo":"sinelaw/fresh","slug":"pkg-bundle-plugin-not-found-plugin-entry","errorCode":null,"errorMessage":"[pkg] Bundle plugin not found: ${plugin.entry}","messagePattern":"\\[pkg\\] Bundle plugin not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/fresh-editor/plugins/pkg.ts","lineNumber":1701,"sourceCode":"\n  // Load all plugins from the bundle\n  if (manifest.fresh?.plugins) {\n    for (const plugin of manifest.fresh.plugins) {\n      let entryPath = editor.pathJoin(packageDir, plugin.entry);\n\n      // Try .js fallback if .ts doesn't exist\n      if (!fsLocal.fileExists(entryPath) && entryPath.endsWith(\".ts\")) {\n        const jsPath = entryPath.replace(/\\.ts$/, \".js\");\n        if (fsLocal.fileExists(jsPath)) {\n          entryPath = jsPath;\n        }\n      }\n\n      if (fsLocal.fileExists(entryPath)) {\n        editor.debug(`[pkg] Loading bundle plugin: ${plugin.entry}`);\n        await editor.loadPlugin(entryPath);\n      } else {\n        editor.warn(`[pkg] Bundle plugin not found: ${plugin.entry}`);\n      }\n    }\n  }\n\n  // Reload themes if bundle contains any (uses same format as theme-packs)\n  if (manifest.fresh?.themes && manifest.fresh.themes.length > 0) {\n    editor.debug(`[pkg] Bundle contains ${manifest.fresh.themes.length} theme(s), reloading themes`);\n    editor.reloadThemes();\n  }\n\n  // Apply grammar changes\n  await editor.reloadGrammars();\n  editor.debug(`[pkg] Bundle loaded: ${bundleName}`);\n}\n\n/**\n * Checkout a specific version in a package directory\n */","sourceCodeStart":1683,"sourceCodeEnd":1719,"githubUrl":"https://github.com/sinelaw/fresh/blob/67894ca5463dbd7a89bb31add4627c27d6b79d83/crates/fresh-editor/plugins/pkg.ts#L1683-L1719","documentation":"While activating an installed bundle, pkg.ts iterates manifest.fresh.plugins and calls editor.loadPlugin(entryPath) only if fsLocal.fileExists(entryPath); when the bundle plugin entry file is missing on disk it warns 'Bundle plugin not found: <entry>' and skips loading that plugin instead of failing the whole bundle.","triggerScenarios":"An installed bundle's manifest lists a plugin whose entry file does not exist at the expected path inside the bundle directory: bad entry path in the manifest, incomplete install/extraction, or files deleted after install.","commonSituations":"Publishing a bundle where the plugin 'entry' path has a typo or wrong case (case-sensitive Linux filesystems); archives built without the plugin JS file; partial installs interrupted mid-extraction.","solutions":["Check manifest.fresh.plugins[].entry against the actual files in the installed bundle directory.","Reinstall the bundle to restore missing files (case-sensitive path/casing included).","Fix and republish the bundle so the entry file is included at the declared path.","Remove the stale plugin entry from the manifest if the plugin was intentionally dropped."],"exampleFix":"// manifest\n[[fresh.plugins]]\nentry = \"plugin/main.js\"\n// after: ensure bundle ships plugin/main.js (watch case: Plugin/Main.js is NOT the same on Linux)","handlingStrategy":"validation","validationCode":"for (const p of manifest.fresh?.plugins ?? []) {\n  const entryPath = path.join(bundleDir, p.entry);\n  if (!fs.existsSync(entryPath)) throw new Error(`bundle missing plugin entry: ${p.entry}`);\n}","typeGuard":"function bundleComplete(manifest, dir) { return (manifest.fresh?.plugins ?? []).every(p => fs.existsSync(path.join(dir, p.entry))); }","tryCatchPattern":"try { await loadBundle(bundleDir); } catch (e) { if (e.message.includes('plugin entry')) { editor.warn('bundle incomplete — reinstalling'); await installBundle(bundleUrl); } else throw e; }","preventionTips":["Verify declared entry paths exist (with exact case) before publishing bundles.","Include the packaging step in CI so entry files cannot be forgotten.","Reinstall bundles after editor updates or manual tampering with the packages directory.","Avoid moving/renaming files inside installed bundle directories."],"tags":["package-management","bundle","file-not-found","plugin"],"backgroundTag":"file-not-found","analyzedSha":"67894ca5463dbd7a89bb31add4627c27d6b79d83","analyzedAt":"2026-09-13T15:04:03.701Z","contentChangedAt":"2026-09-13T15:04:03.701Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}