Skip to content

build: example scripts at the repo root cannot import @simlin packages #827

Open

Description

@bpowers

Every script in examples/ and the ones in scripts/ that import @simlin/* packages fail from a fresh checkout with Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@simlin/engine'.
The root package.json declares no @simlin/* dependencies, so pnpm never links them into the root node_modules, which is where Node resolves imports for files outside a workspace package.

Example

pnpm install && pnpm build
node examples/svg.mjs examples/rabfox_birgit.mdl
# Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@simlin/engine'

The same import chain resolves from inside src/diagram, which declares these packages.

Affected: examples/{sim,sim-embed,serialize,svg}.mjs, scripts/debug-diagram-gen.mjs, scripts/debug-import.mjs.

Why it matters

The examples/ scripts are the closest thing we have to "how to call the engine from Node", and none of them run.
Nothing in CI runs them, so they will stay broken.

Fix

Add the needed packages (@simlin/engine, @simlin/core, @simlin/diagram, @simlin/server) as workspace:* dev dependencies in the root package.json.
Alternative: delete the scripts nobody uses.
A CI smoke run of one example is optional and cheap.

Pointers

  • root package.json, pnpm-workspace.yaml

Activity

  1. added
    ci
    bug
    on Oct 12, 2026
  2. changed the title [-]examples/svg.mjs and scripts/debug-diagram-gen.mjs fail with ERR_MODULE_NOT_FOUND: @simlin/engine[/-] [+]build: example scripts at the repo root cannot import @simlin packages[/+] on Oct 12, 2026
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

    bugci

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions