openclaw - 💡(How to fix) Fix Build missing docs/reference/templates in dist — breaks workspace bootstrap [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54396Fetched 2026-04-08 01:28:11
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

Error: Missing workspace template: AGENTS.md (C:\Users\jarro\AppData\Roaming\npm\node_modules\openclaw\dist\docs\reference\templates\AGENTS.md). Ensure docs/reference/templates are packaged.

Root Cause

The memory-lancedb extension fails to load because @lancedb/lancedb is not listed in dependencies, peerDependencies, or optionalDependencies in package.json — even though the extension is exported and the plugin loader tries to load it. Consider adding it as an optionalDependency or peerDependency so users get a clear install hint.

Fix Action

Workaround

Manually copy the templates:

mkdir -p node_modules/openclaw/dist/docs/reference/templates
cp node_modules/openclaw/docs/reference/templates/* node_modules/openclaw/dist/docs/reference/templates/

Code Example

Error: Missing workspace template: AGENTS.md (C:\Users\jarro\AppData\Roaming\npm\node_modules\openclaw\dist\docs\reference\templates\AGENTS.md). Ensure docs/reference/templates are packaged.

---

mkdir -p node_modules/openclaw/dist/docs/reference/templates
cp node_modules/openclaw/docs/reference/templates/* node_modules/openclaw/dist/docs/reference/templates/
RAW_BUFFERClick to expand / collapse

Bug

The docs/reference/templates/ directory is not copied into dist/ during the build. This causes telegram (and likely other providers) to fail at dispatch time with:

Error: Missing workspace template: AGENTS.md (C:\Users\jarro\AppData\Roaming\npm\node_modules\openclaw\dist\docs\reference\templates\AGENTS.md). Ensure docs/reference/templates are packaged.

Details

  • Version: 2026.3.23-2
  • Platform: Windows 11 (npm global install)
  • The templates exist in docs/reference/templates/ (13 files: AGENTS.md, SOUL.md, TOOLS.md, etc.)
  • dist/workspace-D4K6QX9X.js:128 calls resolveWorkspaceTemplateDir() which resolves to dist/docs/reference/templates/
  • That directory doesn't exist in the published package

Workaround

Manually copy the templates:

mkdir -p node_modules/openclaw/dist/docs/reference/templates
cp node_modules/openclaw/docs/reference/templates/* node_modules/openclaw/dist/docs/reference/templates/

Suggested fix

Either:

  1. Copy docs/reference/templates/ into dist/docs/reference/templates/ during the build step
  2. Or update resolveWorkspaceTemplateDir() to resolve to the non-dist path since docs/ is already included in the package files field

Secondary: @lancedb/lancedb not declared as peer/optional dependency

The memory-lancedb extension fails to load because @lancedb/lancedb is not listed in dependencies, peerDependencies, or optionalDependencies in package.json — even though the extension is exported and the plugin loader tries to load it. Consider adding it as an optionalDependency or peerDependency so users get a clear install hint.

extent analysis

Fix Plan

To resolve the issue, we will implement the suggested fix by copying the docs/reference/templates/ directory into dist/docs/reference/templates/ during the build step.

Step-by-Step Solution

  1. Update build script: Modify the build script to include the docs/reference/templates/ directory in the dist/ directory.
  2. Use a build tool: Utilize a build tool like gulp or webpack to automate the copying process.

Example Code (using Node.js fs module)

const fs = require('fs');
const path = require('path');

// Define source and destination paths
const srcPath = path.join(__dirname, 'docs', 'reference', 'templates');
const destPath = path.join(__dirname, 'dist', 'docs', 'reference', 'templates');

// Create destination directory if it doesn't exist
fs.mkdirSync(destPath, { recursive: true });

// Copy files from source to destination
fs.readdirSync(srcPath).forEach(file => {
  const srcFile = path.join(srcPath, file);
  const destFile = path.join(destPath, file);
  fs.copyFileSync(srcFile, destFile);
});

Verification

To verify the fix, run the build script and check if the docs/reference/templates/ directory is correctly copied into dist/docs/reference/templates/. Then, test the application to ensure that the error is resolved.

Extra Tips

  • Consider adding @lancedb/lancedb as an optionalDependency or peerDependency in package.json to provide a clear install hint for users.
  • Use a build tool to automate the copying process and make it more efficient.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING