Skip to content

[Test] Add e2e test to prevent runtime 'Cannot find module' errors for plugin dependencies #7668

@ImBIOS

Description

@ImBIOS

Summary

Add e2e tests to protect against runtime module resolution errors like the one reported in #6291.

Background

Reference issue: #6291

The error occurred when the minimax-portal-auth plugin failed to load because the clawdbot/plugin-sdk module could not be found at runtime:

Error: Cannot find module 'clawdbot/plugin-sdk'
Require stack:
- /root/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/extensions/minimax-portal-auth/index.ts

This type of error suggests that:

  1. The plugin's dependencies aren't being bundled correctly
  2. The module resolution is failing at runtime despite working during build
  3. There's no test that validates plugin loading works end-to-end

Task

Add e2e tests that:

  1. Load and verify all bundled plugins/extensions can be required without errors
  2. Test that plugin dependencies are resolved correctly after packaging/bundling
  3. Validate the packaged output works in a clean environment (simulating npm install behavior)

Acceptance Criteria

  • E2e test suite exists that validates plugin loading
  • Test runs in CI/CD pipeline
  • Test catches missing peer dependencies or incorrect bundling
  • Documentation on how to run the e2e tests locally

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions