{"record":{"id":"c8017c73f874162d","repo":"remix-run/remix","slug":"err-invalid-arg-value","errorCode":"ERR_INVALID_ARG_VALUE","errorMessage":"The argument 'error' may not be an empty object. Received ${stringify(expectedError)}","messagePattern":"The argument 'error' may not be an empty object\\. Received (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/assert/src/lib/assert.ts","lineNumber":198,"sourceCode":"function validateExpectedDoesNotError(expectedError: unknown): void {\n  if (\n    expectedError == null ||\n    typeof expectedError === 'function' ||\n    expectedError instanceof RegExp\n  ) {\n    return\n  }\n\n  throw createInvalidArgumentTypeError(\n    'expected',\n    'of type function or an instance of RegExp',\n    expectedError,\n  )\n}\n\nfunction validateExpectedObject(expectedError: object): void {\n  if (Object.keys(expectedError).length === 0) {\n    throw createInvalidArgumentValueError(\n      'error',\n      `may not be an empty object. Received ${stringify(expectedError)}`,\n    )\n  }\n}\n\nfunction getMissingExceptionMessage(\n  operator: 'throws' | 'rejects',\n  expectedError: unknown,\n  message: AssertionMessage | undefined,\n): string {\n  let expectedName = getExpectedErrorName(expectedError)\n  let kind = operator === 'throws' ? 'exception' : 'rejection'\n  let base =\n    expectedName === undefined\n      ? `Missing expected ${kind}`\n      : `Missing expected ${kind} (${expectedName})`\n","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/assert/src/lib/assert.ts#L180-L216","documentation":"When assert.throws/rejects matches errors against a plain-object expectation, the object must have at least one key; an empty object {} is meaningless as a matcher and throws ERR_INVALID_ARG_VALUE before the assertion runs.","triggerScenarios":"Passing {} as the expected error: assert.throws(fn, {}).","commonSituations":"Programmatically building expectation objects where a lookup returns empty, or leftover placeholder {} from refactoring tests.","solutions":["Add at least one property to match on: { name: 'TypeError' } or { message: '...' }","Remove the object and assert on the class or message RegExp instead"],"exampleFix":"// before\nassert.throws(() => f(), {})\n// after\nassert.throws(() => f(), { name: 'RangeError' })","handlingStrategy":"validation","validationCode":"if (typeof expected === 'object' && Object.keys(expected).length === 0) throw new Error('empty expectation')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include at least one property (name, code, message) in object expectations"],"tags":["assert","invalid-arg-value","validation"],"backgroundTag":"assert-invalid-argument-type","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}