Skip to content

[Bug]: openclaw browser extension install fails: bundled extension path resolves outside package #8905

@kelvinCB

Description

@kelvinCB

Summary

openclaw browser extension install fails with:

Error: Bundled Chrome extension is missing. Reinstall OpenClaw and try again.

…even though the bundled extension assets exist in the installed npm package.

This looks like an off‑by‑one path bug in bundledExtensionRootDir() (it resolves ../../assets/chrome-extension from dist/, which ends up pointing to .../node_modules/assets/... instead of .../node_modules/openclaw/assets/...).

Steps to reproduce

  1. Install OpenClaw globally via npm:
npm i -g openclaw@2026.2.2-3
  1. Run:
openclaw browser extension install

Expected behavior

The command installs the bundled extension to the OpenClaw state dir and prints the installed extension path.

Actual behavior

It errors with:

Error: Bundled Chrome extension is missing. Reinstall OpenClaw and try again.

Environment

  • OpenClaw version: 2026.2.2-3 (9c5941b)
  • OS: macOS (zsh)
  • Install method: npm i -g openclaw@2026.2.2-3
  • Node: v22.22.0 (nvm)

Evidence

The bundled extension exists at:

  • .../lib/node_modules/openclaw/assets/chrome-extension/manifest.json

But the computed bundled path resolves to:

  • .../lib/node_modules/assets/chrome-extension

…which does not exist in a standard npm global install layout.

Relevant code (built output in 2026.2.2-3):

function bundledExtensionRootDir() {
  const here = path.dirname(fileURLToPath(import.meta.url));
  return path.resolve(here, "../../assets/chrome-extension");
}

If dist lives under .../openclaw/dist, this likely should be ../assets/chrome-extension (one level up), not ../../.

Workaround

Creating a symlink at the location OpenClaw currently resolves makes the install succeed:

cd /path/to/.../lib/node_modules
mkdir -p assets
ln -sf ../openclaw/assets/chrome-extension assets/chrome-extension
openclaw browser extension install

Suggested fix

  • Adjust the bundled extension root resolution so it points to the package’s assets/chrome-extension directory.
  • (Optional) Add a small unit test that asserts the resolved directory contains manifest.json.

Logs / screenshots

I can provide full openclaw doctor output if needed (no secrets), but the error above should be sufficient to reproduce.

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