Skip to content

Bug: npm package ships TypeScript source only — no compiled output (dist/) #1619

@SinoGod

Description

@SinoGod

Bug: npm package ships TypeScript source only — no compiled output (dist/)

Description

The @memtensor/memos-local-openclaw-plugin npm package (both 1.0.8 and 1.0.10) publishes only TypeScript source code without compiled JavaScript output. This causes the plugin to fail loading in OpenClaw 2026.5.4, which expects compiled JS (dist/index.js, dist/index.mjs, or dist/index.cjs).

Steps to Reproduce

  1. Run the official install script:
    curl -fsSL https://cdn.memtensor.com.cn/memos-local-openclaw/install.sh | bash
  2. The install completes but the plugin fails to load with:
    plugins.slots.memory: plugin not found: memos-local-openclaw-plugin
    
  3. OpenClaw reports:
    installed plugin package requires compiled runtime output for TypeScript entry index.ts: expected ./dist/index.js, ./dist/index.mjs, ./dist/index.cjs, index.js, index.mjs, index.cjs
    

Root Cause

  • package.json has "main": "index.ts" (pointing to raw TypeScript)
  • prepublishOnly script is: echo 'Source-only publish — no build needed.'
  • No dist/ directory exists in the published package
  • No tsconfig.json is included

The package was designed assuming the runtime would handle TypeScript directly, but OpenClaw's plugin loader requires compiled JS.

Environment

  • OpenClaw: 2026.5.4 (stable)
  • OS: macOS 26.3.1 (arm64)
  • Node.js: v22.18.0
  • Plugin version: 1.0.10 (also confirmed on 1.0.8)

Workaround

Manually compile the plugin after install:

cd ~/.openclaw/extensions/memos-local-openclaw-plugin

# Create tsconfig.json
cat > tsconfig.json << 'TSEOF'
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "outDir": "./dist",
    "rootDir": ".",
    "declaration": false,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "strict": false,
    "noEmit": false
  },
  "include": ["index.ts", "src/**/*.ts"],
  "exclude": ["node_modules", "dist", "scripts", "skill"]
}
TSEOF

# Create type shim for openclaw/plugin-sdk
mkdir -p dist
cat > dist/openclaw-plugin-sdk.d.ts << 'DTEOF'
export interface OpenClawPluginApi {
  registerTool(...args: any[]): void;
  registerHook(...args: any[]): void;
  registerMemoryCapability(...args: any[]): void;
  getConfig(): any;
  getLogger(): any;
  logger: any;
  [key: string]: any;
}
DTEOF

# Compile
npx tsc

Then re-register the plugin in ~/.openclaw/openclaw.json.

Suggested Fix

Either:

  1. Add a tsconfig.json and include a prepublishOnly build step that compiles to dist/
  2. Or ship the compiled JS alongside the TypeScript source in the npm package
  3. Or change "main" in package.json to point to a compiled entry point

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions