Skip to content

[msteams] path-to-regexp v8 breaking: /api* wildcard in Bot Framework CloudAdapter #54960

@mrbrl

Description

@mrbrl

Bug

The MS Teams plugin bundles a Bot Framework CloudAdapter that registers:

this.express.use("/api*", express_1.default.json());

This is valid Express 4 syntax, but Express 5 ships path-to-regexp v8 which requires named wildcards:

Missing parameter name at index 5: /api*; visit https://git.new/pathToRegexpError for info

Where

dist/dist-B5zoW1KK.js line ~3425 (bundled Bot Framework adapter)

Fix

Replace:

this.express.use("/api*", express_1.default.json());

With:

this.express.use("/api{*path}", express_1.default.json());

Impact

  • Error appears in Control UI channel status for MS Teams
  • JSON body parser may fail to register on /api/* routes
  • Teams webhook on /api/messages may still work via exact match, but the wildcard middleware is broken

Workaround

Manual patch of the bundled dist file (overwritten on update):

sudo sed -i 's|this.express.use("/api\\*", express_1.default.json())|this.express.use("/api{*path}", express_1.default.json())|' /usr/lib/node_modules/openclaw/dist/dist-B5zoW1KK.js
openclaw gateway restart

Environment

  • OpenClaw: 2026.3.24
  • Express: 5.2.1
  • path-to-regexp: 8.3.0
  • Node: v24.14.0

Related

https://git.new/pathToRegexpError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions