{"record":{"id":"1e0cdf8b68a36c56","repo":"sickn33/agentic-awesome-skills","slug":"failed-to-build-deps-depsresult-left","errorCode":null,"errorMessage":"Failed to build deps: ${depsResult.left}","messagePattern":"Failed to build deps: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/fp-backend/SKILL.md","lineNumber":1195,"sourceCode":"import { pipe } from 'fp-ts/function'\nimport { describe, it, expect, beforeAll, afterAll } from 'vitest'\nimport { buildDeps, destroyDeps, AppDeps } from '../../deps'\nimport * as UserService from '../../services/user.service'\n\ndescribe('UserService Integration', () => {\n  let container: PostgreSqlContainer\n  let deps: AppDeps\n\n  beforeAll(async () => {\n    // Start PostgreSQL container\n    container = await new PostgreSqlContainer().start()\n\n    // Build real dependencies with test database\n    process.env.DATABASE_URL = container.getConnectionUri()\n\n    const depsResult = await buildDeps()()\n    if (E.isLeft(depsResult)) {\n      throw new Error(`Failed to build deps: ${depsResult.left}`)\n    }\n    deps = depsResult.right\n\n    // Run migrations\n    await deps.db.$executeRaw`CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"`\n    // ... run Prisma migrations\n  }, 60000)\n\n  afterAll(async () => {\n    await destroyDeps(deps)()\n    await container.stop()\n  })\n\n  it('should create and retrieve a user', async () => {\n    // Create user\n    const createResult = await UserService.create({\n      email: 'integration@test.com',\n      password: 'password123',","sourceCodeStart":1177,"sourceCodeEnd":1213,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/fp-backend/SKILL.md#L1177-L1213","documentation":"Thrown by the integration-test setup example in the fp-backend skill (skills/fp-backend/SKILL.md:1195) when buildDeps()(), an Either/TaskEither-style dependency initializer, returns a Left. It surfaces any startup failure of the application dependency graph (database connection, config parsing, client construction) as a Jest beforeAll error so tests abort fast.","triggerScenarios":"Running the documented integration tests when buildDeps fails: wrong or unreachable DATABASE_URL (the just-started PostgreSQL container URI was not picked up), missing required config/env vars, or a Prisma client that cannot instantiate against the container.","commonSituations":"Env var not propagated before buildDeps runs; Docker/Testcontainers unavailable or slow so the container URI is stale; Prisma engine mismatch; required secrets absent in CI. The interpolated depsResult.left usually contains the underlying cause string.","solutions":["Log or inspect depsResult.left: it carries the real initialization error; fix that first","Verify process.env.DATABASE_URL is set from container.getConnectionUri() before buildDeps()() is invoked","Ensure Testcontainers/Docker is running and the PostgreSQL image can start within the 60000ms beforeAll timeout","Check all required config values read inside buildDeps are present in the test environment"],"exampleFix":"// before\nconst depsResult = await buildDeps()()\nif (E.isLeft(depsResult)) {\n  throw new Error(`Failed to build deps: ${depsResult.left}`)\n}\n\n// after (surface the structural cause)\nif (E.isLeft(depsResult)) {\n  throw new Error(`Failed to build deps: ${JSON.stringify(depsResult.left)}`)\n}","handlingStrategy":"try-catch","validationCode":"process.env.DATABASE_URL = container.getConnectionUri()\nif (!process.env.DATABASE_URL) throw new Error('DATABASE_URL missing before buildDeps')","typeGuard":null,"tryCatchPattern":"try {\n  const depsResult = await buildDeps()()\n  if (E.isLeft(depsResult)) throw new Error(`Failed to build deps: ${JSON.stringify(depsResult.left)}`)\n  deps = depsResult.right\n} catch (err) {\n  console.error('test setup failed - check Docker and env:', err)\n  throw err\n}","preventionTips":["Set every env var buildDeps reads before invoking it","Print the Left value structurally, not just its toString","Ensure Docker/Testcontainers is up before the suite starts"],"tags":["integration-testing","testcontainers","dependency-injection","fp-ts"],"backgroundTag":"dependency-injection-startup-failure","analyzedSha":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}