#8526: fix(docker): copy extension package.json files before pnpm install
docker
stale
Fixes #5292
Fixes #6151
Fixes #6989
## Problem
Bundled extensions fail to load at runtime with "Cannot find module" errors. For example, the Matrix plugin:
```
[plugins] matrix failed to load: Cannot find module '@vector-im/matrix-bot-sdk'
```
This affects all extensions that declare external dependencies (matrix, diagnostics-otel, memory-lancedb, msteams, etc.)
## Cause
The Dockerfile copies `pnpm-workspace.yaml` — which declares `extensions/*` as workspace members — but doesn't copy the extension directories before `pnpm install`:
```dockerfile
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY ui/package.json ./ui/package.json # ✅ present at install time
# ❌ extensions/ not copied yet
RUN pnpm install --frozen-lockfile # skips extension deps
COPY . . # source arrives too late
```
pnpm matches the `extensions/*` glob against the filesystem, finds nothing, and silently skips their dependencies.
## Fix
```dockerfile
COPY extensions/ ./extensions/
```
Copy `extensions/` before install, matching the existing pattern for `ui/`. This resolves all 31 extension workspace members and their dependencies.
## Verified
Built and deployed. Before: `pnpm install` reported 2 workspace projects. After: 32. Matrix plugin loads, connects, and handles encrypted messages with no errors.
Most Similar PRs
#19502: Docker: install extension workspace deps for memory-lancedb
by Hua688 · 2026-02-17
72.3%
#20055: fix(plugins): strip workspace:* dev-deps before npm install
by openperf · 2026-02-18
65.2%
#11454: fix(plugins): remove workspace:* from extension dependencies
by AnonO6 · 2026-02-07
63.9%
#16140: fix: convert installable extension deps from workspace:* to peerDep...
by battman21 · 2026-02-14
63.5%
#12103: fix: add missing zod dependency to 7 extensions
by mcaxtr · 2026-02-08
63.4%
#20415: fix(extensions): use dist/ import paths for bundled extensions
by 88plug · 2026-02-18
61.2%
#20278: Fix/matrix missing bot sdk dependency
by saurav470 · 2026-02-18
61.1%
#13671: fix(memory-lancedb): ship @lancedb/lancedb for bundled extension
by CryptoJym · 2026-02-10
60.9%
#20751: fix: zfs dockerfile pnpm hardlink
by cipher416 · 2026-02-19
60.6%
#19807: fix: apply #19779 Docker/TS strict-build fixes
by dalefrieswthat · 2026-02-18
60.3%