{"record":{"id":"af964ee4d32a14c7","repo":"beekeeper-studio/beekeeper-studio","slug":"bundled-config-file-not-found-src-this-should","errorCode":null,"errorMessage":"Bundled config file not found: ${src}. This should not happen. Please report an issue.","messagePattern":"Bundled config file not found: (.+?)\\. This should not happen\\. Please report an issue\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/studio/src/common/bksConfig/mainBksConfig.ts","lineNumber":150,"sourceCode":"          path,\n          value\n        });\n      }\n    }\n  }\n\n  traverse(deprecations);\n\n  return results;\n}\n\nconst bundledConfigPath = path.join(process.resourcesPath);\n\nfunction copyBundledConfig(file: ConfigFileName, dest: string) {\n  log.info(`Copying bundled config ${file} to ${dest}.`);\n  const src = path.join(bundledConfigPath, file);\n  if (!existsSync(src)) {\n    throw new Error(\n      `Bundled config file not found: ${src}. This should not happen. Please report an issue.`\n    );\n  }\n  try {\n    accessSync(dest, constants.W_OK);\n    copyFileSync(src, dest);\n  } catch (err) {\n    log.warn(`Skipping copy of ${file}. Permission denied or dest not writable:`, err.message);\n  }\n}\n\nfunction readConfig(filePath: string) {\n  try {\n    const config = parseIni(readFileSync(filePath, \"utf-8\"));\n    log.debug(`Successfully read config ${filePath}.`);\n    return processRawConfig(config);\n  } catch (error) {\n    log.error(`Failed reading config ${filePath}.`, error);","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/beekeeper-studio/beekeeper-studio/blob/4e3e03e3223b2b71a1af8926d455f533b80af837/apps/studio/src/common/bksConfig/mainBksConfig.ts#L132-L168","documentation":"copyBundledConfig copies a config file shipped with the packaged app from process.resourcesPath into the user config location. It throws when the expected bundled file does not exist next to the executable. In a correct package build these files are always present, so the message asks for a bug report.","triggerScenarios":"Running a packaged (non-dev) build where loadConfig resolved a config file (e.g. config.ini) that was never included in process.resourcesPath by electron-builder; running the app from a partially extracted/corrupted install; launching via a wrapper that changes the resources path so bundledConfigPath points at an empty directory.","commonSituations":"Custom electron-builder configs that drop the extraResources entry for config files; testing a packaged build without running the full 'yarn bks:build' packaging step; portable/Scoop installs with missing files.","solutions":["Rebuild the packaged app with the full build (yarn bks:build) so bundled config files are emitted into resources","Verify electron-builder extraResources/files config includes the bundled config files","Reinstall or re-extract the app to repair a corrupted install","If reproducible in a correct build, report the issue to Beekeeper Studio maintainers"],"exampleFix":"// electron-builder-config.js\n// before\nextraResources: []\n// after\nextraResources: [{ from: 'config/', to: 'config/' }]","handlingStrategy":"try-catch","validationCode":"import { existsSync } from 'fs'\nimport path from 'path'\nconst src = path.join(process.resourcesPath, file)\nif (!existsSync(src)) {\n  console.warn(`Bundled config missing: ${src}; falling back to defaults`)\n}","typeGuard":"function hasBundledConfig(base: string, file: string): boolean {\n  return existsSync(path.join(base, file))\n}","tryCatchPattern":"try {\n  const config = loadConfig(file, filePath)\n} catch (e) {\n  if (e.message.startsWith('Bundled config file not found')) {\n    log.warn('Bundled config missing; using defaults', e.message)\n    config = defaultConfigValues\n  } else throw e\n}","preventionTips":["Keep the electron-builder extraResources/files entries for config files intact","Run the full packaging build before testing packaged builds","Verify process.resourcesPath contents in a smoke test after packaging","Reinstall cleanly if upgrading in place"],"tags":["electron","config","packaging"],"backgroundTag":"missing-bundled-resource","analyzedSha":"4e3e03e3223b2b71a1af8926d455f533b80af837","analyzedAt":"2026-08-31T23:21:23.379Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}