Skip to content

[Bug]: E2E test fails with plugin load error "Cannot read properties of undefined (reading 'find')" #289

@sjnims

Description

@sjnims

Bug Description

When running E2E tests, the "runs full evaluation pipeline for all component types" test fails during Stage 3 plugin verification with the error:

Plugin failed to load: Plugin load failed: Cannot read properties of undefined (reading 'find')

Important context: All unit tests pass. This issue only manifests during E2E test execution with real API calls and the full plugin loading flow.

Steps to Reproduce

  1. Run RUN_E2E_TESTS=true npm test -- tests/e2e/
  2. Observe the "runs full evaluation pipeline for all component types" test
  3. See the plugin load error during Stage 3

Expected Behavior

The plugin at tests/fixtures/valid-plugin should load successfully during E2E test execution, just as it does in unit tests.

Actual Behavior

Plugin verification fails with:

[INFO] Plugin failed to load: /Users/.../tests/fixtures/valid-plugin
  Error: Plugin load failed: Cannot read properties of undefined (reading 'find')
  Type: unknown
  Hint: Check logs for detailed error information

The test fails even after retry, causing the E2E test suite to report 1 failure.

Environment

  • OS: macOS
  • Node.js: v25.x
  • Test runner: Vitest

Error Logs / CLI Output

[ERROR] Plugin failed to load: Plugin load failed: Cannot read properties of undefined (reading 'find')

============================================================
STAGE: STAGE 3: EXECUTION (5 items)
============================================================
[INFO] Verifying plugin load...
[INFO] Plugin failed to load: /Users/stevenims/Projects/cc-plugin-eval/tests/fixtures/valid-plugin
  Error: Plugin load failed: Cannot read properties of undefined (reading 'find')
  Type: unknown
  Hint: Check logs for detailed error information

Additional Context

  • Unit tests for Stage 3 execution pass without issues
  • The plugin structure appears valid (Stage 1 analysis succeeds)
  • This suggests either:
    1. An E2E test setup/configuration issue
    2. A real integration bug that only manifests with the full SDK flow
    3. A race condition or environment-specific issue in E2E conditions

Investigation should determine whether this is a test infrastructure problem or an actual code bug in the execution stage.


🤖 Created with Claude Code

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingeffort:medium1-4 hourspriority:highImportant but not blockingsdk:agentClaude Agent SDK usage (Stage 3)stage:executionStage 3: Agent SDK execution with tool capturestatus:analyzedIssue has been analyzed by Claude

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions