Skip to content

bb plugin new scaffolds a plugin that cannot import @get-bb/plugin-sdk/testing: cron-parser is undeclared #2546

Description

@t1mdurden

Summary

bb plugin new scaffolds a plugin that cannot import @get-bb/plugin-sdk/testing — the backend test harness the bundled bb-plugin-authoring skill tells plugin authors to test with. The first createFakePluginHost test in a fresh scaffold fails to load with Cannot find package 'cron-parser', pointing at a file inside node_modules with nothing in the guide to explain it.

Versions and environment

  • bb 0.40.0, desktop app. Also reproduced from source at ad79bbb5ec909524f8f281e62d860c588a86f332.
  • macOS 15 (Darwin 25.3.0), arm64.
  • Node v20.13.1, npm 10.5.2.

Steps to reproduce

bb plugin new probe
cd bb-plugin-probe
npm install --include=dev
npm install --save-dev vitest
cat > server.test.ts <<'TS'
import { it } from "vitest";
import { createFakePluginHost } from "@get-bb/plugin-sdk/testing";
import plugin from "./server";

it("loads", async () => {
  const { bb } = createFakePluginHost({ pluginId: "probe" });
  await plugin(bb);
});
TS
npx vitest run

Expected vs actual

Actual:

FAIL  server.test.ts [ server.test.ts ]
Error: Cannot find package 'cron-parser' imported from
  .../bb-plugin-probe/node_modules/@get-bb/plugin-sdk/dist/testing/index.js

Expected: the test runs. The scaffold already ships the harness's other peers, so the intent is clearly that it works.

Evidence

The backend harness imports exactly four npm packages — better-sqlite3, cron-parser, hono, zod:

All four are optional peers of the SDK, so npm installs none of them:

The scaffold declares three of the four and misses cron-parser:

zod is covered because generated server.ts imports it, so it sits in dependencies.

What you ruled out

  • Not a stale lockfile: npm install --include=dev in a brand-new scaffold, twice, on two machines' worth of clean node_modules.
  • Not the frontend harness: @get-bb/plugin-sdk/testing/app needs React, Testing Library and jsdom, and the skill correctly tells the author to add those. Only the backend entry is affected.
  • Not a duplicate — searched open and closed issues for cron-parser, plugin scaffold, plugin new test.

Suggested priority and effort

Hits every plugin author who follows the guide's testing section, which is the guide's own recommended workflow. Workaround is one npm i -D cron-parser once you have decoded the error. Effort: one line plus a regression test.

AGENT GENERATED

Metadata

Metadata

Assignees

No one assigned

    Labels

    clibb CLIconfirmed-reproBug reproduced independently; see linked reportpluginsPlugin SDK, runtime, marketplace

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions