beekeeper-studio/beekeeper-studio · error

Bundled config file not found: ${src}. This should not happe

Error message

Bundled config file not found: ${src}. This should not happen. Please report an issue.

What it means

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.

Source

Thrown at apps/studio/src/common/bksConfig/mainBksConfig.ts:150

          path,
          value
        });
      }
    }
  }

  traverse(deprecations);

  return results;
}

const bundledConfigPath = path.join(process.resourcesPath);

function copyBundledConfig(file: ConfigFileName, dest: string) {
  log.info(`Copying bundled config ${file} to ${dest}.`);
  const src = path.join(bundledConfigPath, file);
  if (!existsSync(src)) {
    throw new Error(
      `Bundled config file not found: ${src}. This should not happen. Please report an issue.`
    );
  }
  try {
    accessSync(dest, constants.W_OK);
    copyFileSync(src, dest);
  } catch (err) {
    log.warn(`Skipping copy of ${file}. Permission denied or dest not writable:`, err.message);
  }
}

function readConfig(filePath: string) {
  try {
    const config = parseIni(readFileSync(filePath, "utf-8"));
    log.debug(`Successfully read config ${filePath}.`);
    return processRawConfig(config);
  } catch (error) {
    log.error(`Failed reading config ${filePath}.`, error);

View on GitHub (pinned to 4e3e03e322)

Solutions

  1. Rebuild the packaged app with the full build (yarn bks:build) so bundled config files are emitted into resources
  2. Verify electron-builder extraResources/files config includes the bundled config files
  3. Reinstall or re-extract the app to repair a corrupted install
  4. If reproducible in a correct build, report the issue to Beekeeper Studio maintainers

Example fix

// electron-builder-config.js
// before
extraResources: []
// after
extraResources: [{ from: 'config/', to: 'config/' }]
Defensive patterns

Strategy: try-catch

Validate before calling

import { existsSync } from 'fs'
import path from 'path'
const src = path.join(process.resourcesPath, file)
if (!existsSync(src)) {
  console.warn(`Bundled config missing: ${src}; falling back to defaults`)
}

Type guard

function hasBundledConfig(base: string, file: string): boolean {
  return existsSync(path.join(base, file))
}

Try / catch

try {
  const config = loadConfig(file, filePath)
} catch (e) {
  if (e.message.startsWith('Bundled config file not found')) {
    log.warn('Bundled config missing; using defaults', e.message)
    config = defaultConfigValues
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of beekeeper-studio/beekeeper-studio@4e3e03e322 (2026-08-31). Data as JSON: /api/errors/af964ee4d32a14c7. Report an issue: GitHub.