Skip to content

chalk is an optionalDependency but QUICServer imports it unconditionally (breaks --omit=optional installs) #50

Open

Description

@ruvnet

What happens: agentdb lists chalk in optionalDependencies (npm view [email protected] optionalDependencies.chalk → ^5.3.0). But dist/src/controllers/QUICServer.js imports it at module load. With npm install --omit=optional, importing anything that reaches QUICServer fails with ERR_MODULE_NOT_FOUND: chalk.

Where we hit it: ruflo ADR-525 (ruvnet/ruflo#4866) tried to install agentic-flow's learning stack lean:

  • npm install --omit=optional --prefix <root> agentic-flow@^3 better-sqlite3: 16.6 s, 1050 MB.
  • The same install without --omit=optional: 29 s, 1842 MB.

The lean install fails at import('agentic-flow/dist/reasoningbank') → agentdb QUICServer.js → chalk. Measured in a fresh node:22 container with an empty npm cache.

Ask (either works):

  1. Move chalk to dependencies. It's small.
  2. Or load it lazily or guarded in QUICServer, so the module loads without it.

Related: better-sqlite3 behaves the same way through agentic-flow's ReasoningBank: optional, but required at import. Once both are fixed, consumers can skip onnxruntime (~690 MB, via @huggingface/transformers) with --omit=optional and still have working learning.

🤖 Generated with RuFlo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions