remix-run/remix · error · AssertionError
expected promise to reject, but it resolved with: ${stringif
Error message
expected promise to reject, but it resolved with: ${stringify(result.value)} What it means
`remix db seed` requires a seed script path from `db.seed` in `remix.json` or the `--seed` flag. This is the plan-time check in `resolveDatabaseCommandPlan`; without a seed path the plan cannot be built because there's nothing to execute.
Source
Thrown at packages/assert/src/lib/expect.ts:478
}
}
function buildMatcher(matcher: keyof Matchers) {
return async (...args: unknown[]) => {
let result = await settle()
if (mode === 'resolves') {
if (!result.resolved) {
throw new AssertionError({
message: `expected promise to resolve, but it rejected with: ${stringify(result.error)}`,
actual: result.error,
operator: `resolves.${matcher}`,
})
}
let m = createMatchers(result.value, negated) as any
m[matcher](...args)
} else {
if (result.resolved) {
throw new AssertionError({
message: `expected promise to reject, but it resolved with: ${stringify(result.value)}`,
actual: result.value,
operator: `rejects.${matcher}`,
})
}
// For rejects.toThrow we check the error against the expected matcher.
if (matcher === 'toThrow') {
let pass = checkErrorMatch(result.error, args[0])
if (negated ? pass : !pass) {
throw new AssertionError({
message:
(negated ? 'expected not ' : 'expected ') +
`error to be ${describeExpectedError(args[0])}, got ${stringify(result.error)}`,
actual: result.error,
expected: args[0],
operator: `rejects.toThrow`,
})
}View on GitHub (pinned to 9696913134)
Solutions
- Pass `--seed ./db/seed.ts` on the command line
- Add `"seed": "./db/seed.ts"` to the `db` section of remix.json
- Create the seed script first if it doesn't exist yet
Example fix
# before remix db seed # after remix db seed --seed ./db/seed.ts
Defensive patterns
Strategy: validation
Validate before calling
let config = JSON.parse(fs.readFileSync('remix.json','utf8'));
let seed = config?.db?.seed ?? './db/seed.ts';
run(['remix','db','seed','--seed',seed]) Prevention
- Set db.seed in remix.json for repeatable seeding
- Create the seed script before referencing it
- Pass --seed when trying things out
When it happens
Trigger: Running `remix db seed` when both `config.db.seed` is absent from remix.json and no `--seed` flag was passed.
Common situations: Fresh apps with no seed script configured yet; config has migrations but omits seed; assuming a default `seed.ts` is auto-detected.
Related errors
- throw new AssertionError({ message, actual, expected, operat
- expect(received).toThrow() requires a function (got ${typeof
- expected promise to resolve, but it rejected with: ${stringi
- ${optionName} values must be strings
- throw new TypeError(message)
AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27).
Data as JSON: /api/errors/44f5695b6e5fafd2.
Report an issue: GitHub.