Skip to content

testkit-js@3.0.0: Missing axios runtime dependency causes crash when running standalone #1314

@nel349

Description

@nel349

Running npm run standalone in example-bboard/bboard-cli after a fresh git clone + npm install should start the Docker environment and launch the interactive BBoard CLI without errors.

All runtime dependencies of testkit-js should be resolvable without consumers needing to know about or explicitly install them.

What should be the expected behavior or results?

The process crashes immediately with:

Error: Cannot find package 'axios' imported from
/Users/norman/Development/midnight/midnight-libraries/example-bboard/node_modules/@midnight-ntwrk/testkit-js/dist/index.mjs

Full stack trace:

node:internal/modules/run_main:123
    triggerUncaughtException(
    ^
Error: Cannot find package 'axios' imported from /Users/norman/Development/midnight/midnight-libraries/example-bboard/node_modules/@midnight-ntwrk/testkit-js/dist/index.mjs
    at packageResolve (/.../node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757:9)
    at moduleResolve (/.../node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:798:18)
    at Object.defaultResolve (/.../node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)

Steps to reproduce

  1. git clone https://github.com/midnightntwrk/example-bboard.git
  2. cd example-bboard
  3. npm install
  4. npm run standalone (from the bboard-cli workspace)

Environment

  • Node.js v22.19.0
  • npm 10.x (workspace mode)
  • @midnight-ntwrk/testkit-js@3.0.0
  • macOS (Darwin 25.2.0)

Root cause

testkit-js/dist/index.mjs contains an import of axios (likely in the FaucetClient class), but axios is either missing from testkit-js's package.json dependencies or is incorrectly listed as a peerDependency.

Workaround

Add axios explicitly to the consumer's root package.json:

npm install axios

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions