koala73/worldmonitor · error

No internal* Convex exports found under convex/ — refusing…

Error message

No internal* Convex exports found under convex/ — refusing to proceed.

What it means

Before doing anything, the script scans the convex/ directory with expectedInternalPatternsFromSource() to build the list of internal* Convex exports it will sync filter rules for. If that scan finds zero matching exports, the script refuses to run rather than writing an empty or wrong filter set, since its whole purpose depends on those exports existing.

Solutions

  1. Run the script from the repository root so convex/ resolves correctly.
  2. Verify `ls convex/` shows files and that they contain internal* exports (e.g. internalQuery, internalMutation) matching the script's source patterns.
  3. Restore the convex/ directory if it was deleted or not checked out (git checkout / full clone).
  4. Update expectedInternalPatternsFromSource() if the export naming convention changed legitimately, then re-run.

Example fix

// before (from wrong directory)
cd scripts && node sync-sentry-convex-probe-filters.mjs
// after
 cd /repo-root && node scripts/sync-sentry-convex-probe-filters.mjs
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync, readdirSync } from 'node:fs';
if (!existsSync('convex') || readdirSync('convex').length === 0) {
  console.error('Run from repo root: convex/ directory is missing or empty.');
  process.exit(1);
}

Prevention

When it happens

Trigger: Running the script from a checkout or working directory where convex/ does not exist, is empty, or contains no files exporting symbols named internal*; running with a changed cwd so the relative convex/ path resolves elsewhere; a rename/refactor that dropped the internal prefix from all Convex exports.

Common situations: Running the script from a subdirectory or the repo root of a different project; sparse/partial clone without convex/; after a refactor renamed publicQuery/internalQuery exports so the pattern no longer matches; CI job checking out only a subset of paths.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of koala73/worldmonitor@e586b8b4b8 (2026-09-22). Data as JSON: /api/errors/fa73599071faad33. Report an issue: GitHub.

Appendix: source

Thrown at scripts/sync-sentry-convex-probe-filters.mjs:517

  if (args.help) {
    console.log(`Usage:
  node scripts/sync-sentry-convex-probe-filters.mjs --check
  node scripts/sync-sentry-convex-probe-filters.mjs --write
  node scripts/sync-sentry-convex-probe-filters.mjs --apply [--dry-run]

Default with no flags: --check`);
    return;
  }

  const modeCount = [args.check, args.write, args.apply].filter(Boolean).length;
  if (modeCount > 1) {
    throw new Error('Pass only one of --check, --write, --apply');
  }
  const mode = args.write ? 'write' : args.apply ? 'apply' : 'check';

  const patterns = expectedInternalPatternsFromSource();
  if (patterns.length === 0) {
    throw new Error('No internal* Convex exports found under convex/ — refusing to proceed.');
  }

  if (mode === 'write') {
    runWrite(patterns);
    return;
  }
  if (mode === 'check') {
    runCheck(patterns);
    return;
  }
  await runApply(patterns, { dryRun: Boolean(args['dry-run']) });
}

const isMain = isMainModule(import.meta.url, process.argv[1]);
if (isMain) {
  main().catch((error) => {
    console.error(
      error instanceof Error ? error.message : String(error),

View on GitHub (pinned to e586b8b4b8)