Skip to content

bug(adapters): useExeca requires execa at module load despite optional peer handling #3764

Description

@Tomeshwari-02

Summary

packages/adapters/src/execa/index.ts has a top-level value import: import { execa } from 'execa'. The rest of the file tries to lazy-load execa and throw a friendly optional-peer error, but the static import means the module can fail before useExeca() is even called.

Reproduction

  1. Install/use @termuijs/adapters without installing the optional execa peer dependency.
  2. Import the adapters package or the execa adapter module.
  3. The runtime attempts to resolve execa during module evaluation.

Expected behavior

The package should be importable without optional peer dependencies installed. The helpful useExeca() error should only appear when the execa adapter is actually used.

Actual behavior

The top-level value import can make the module fail to load before the lazy optional-peer handling runs. The file can use a type-only import for the execa function shape and rely on the existing dynamic import path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

assignedIssue claimed by a contributor.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions