{"record":{"id":"7a860759150fa793","repo":"remix-run/remix","slug":"expected-error-to-be-describeexpectederror-args","errorCode":null,"errorMessage":"expected error to be ${describeExpectedError(args[0])}, got ${stringify(result.error)}","messagePattern":"expected error to be (.+?), got (.+?)","errorType":"exception","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"packages/assert/src/lib/expect.ts","lineNumber":488,"sourceCode":"            actual: result.error,\n            operator: `resolves.${matcher}`,\n          })\n        }\n        let m = createMatchers(result.value, negated) as any\n        m[matcher](...args)\n      } else {\n        if (result.resolved) {\n          throw new AssertionError({\n            message: `expected promise to reject, but it resolved with: ${stringify(result.value)}`,\n            actual: result.value,\n            operator: `rejects.${matcher}`,\n          })\n        }\n        // For rejects.toThrow we check the error against the expected matcher.\n        if (matcher === 'toThrow') {\n          let pass = checkErrorMatch(result.error, args[0])\n          if (negated ? pass : !pass) {\n            throw new AssertionError({\n              message:\n                (negated ? 'expected not ' : 'expected ') +\n                `error to be ${describeExpectedError(args[0])}, got ${stringify(result.error)}`,\n              actual: result.error,\n              expected: args[0],\n              operator: `rejects.toThrow`,\n            })\n          }\n          return\n        }\n        let m = createMatchers(result.error, negated) as any\n        m[matcher](...args)\n      }\n    }\n  }\n\n  return {\n    toBe: buildMatcher('toBe'),","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/assert/src/lib/expect.ts#L470-L506","documentation":"When a sqlite db command is run with `--connection-env VAR`, `overrideConnection` reads the database filename from `process.env[VAR]` and throws if it's undefined or empty — the CLI cannot know which file to open. `:memory:` is the one special allowed value for an in-memory database; other values are resolved against the invocation cwd.","triggerScenarios":"Running `remix db <command> --connection-env DATABASE_FILE` (or with a config using a connection env) where `process.env.DATABASE_FILE` is unset or exported as `''`.","commonSituations":"`.env` not loaded before running the CLI in local shells or CI; env var name mismatches between environments; secrets configured in the pipeline but not exported into the step.","solutions":["Set the variable before running: `DATABASE_FILE=./data/app.db remix db migrate --connection-env DATABASE_FILE`","Source your `.env` first or configure CI to export it","Align the var name in remix.json/flags with what's actually exported"],"exampleFix":"# before\nremix db migrate --connection-env DATABASE_FILE\n# after\nDATABASE_FILE=./data/app.db remix db migrate --connection-env DATABASE_FILE","handlingStrategy":"validation","validationCode":"if (process.env.DATABASE_FILE === undefined || process.env.DATABASE_FILE === '') {\n  throw new Error('DATABASE_FILE must be set (e.g. ./data/app.db)');\n}\nrun(['remix','db','migrate','--connection-env','DATABASE_FILE'])","typeGuard":"function envIsSet(name: string): boolean {\n  let v = process.env[name];\n  return v !== undefined && v !== '';\n}","tryCatchPattern":null,"preventionTips":["Load .env before db commands","Document required env vars in CI templates","Treat empty-string env values as unset"],"tags":["cli","database","env-var","sqlite"],"backgroundTag":"missing-env-var","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}