ui5-middleware-ui5
raw JSON → 3.5.0 verified Sat Apr 25 auth: no javascript
Middleware for ui5-server (UI5 CLI v3) that allows including and serving UI5 application dependencies within the same server instance. Version 3.5.0 is the latest stable release, actively maintained. It enables embedding UI5 apps as dependencies, configurable via ui5.yaml, and supports mount path customization, module-specific configuration, and debug logging. Requires @ui5/cli >= 3.0.0 with specVersion '3.0'. Community-driven project part of the UI5 ecosystem showcase, distinct from official SAP middlewares.
Common errors
error Cannot find module '@ui5/fs' or '@ui5/project' ↓
cause Missing required peer dependencies.
fix
npm install @ui5/fs @ui5/project @ui5/server --save-dev
error UI5 server does not start: Requires specVersion "3.0" ↓
cause ui5.yaml uses an older specVersion (e.g., "2.0" or "1.0").
fix
Update ui5.yaml: specVersion: "3.0" and ensure you have UI5 CLI V3 installed.
error Middleware not included: Could not find module 'ui5-middleware-ui5' ↓
cause Package not installed or missing from node_modules.
fix
npm install ui5-middleware-ui5 --save-dev
error TypeError: Cannot read properties of undefined (reading 'getMiddleware') ↓
cause Incorrect configuration in ui5.yaml; the middleware name is misspelled or the afterMiddleware value is wrong.
fix
Verify middleware name: 'ui5-middleware-ui5', and ensure afterMiddleware points to an existing middleware like 'compression'.
Warnings
breaking Version 3.x requires UI5 CLI V3 and specVersion '3.0'. Incompatible with UI5 CLI V2. ↓
fix Upgrade to UI5 CLI V3 and update your ui5.yaml to specVersion: '3.0'.
deprecated Version 2.x (if available) is deprecated; upgrade to v3 to get latest features and security fixes. ↓
fix Upgrade to v3 and migrate to UI5 CLI V3.
gotcha The middleware uses express router internally; be careful with mountPath collisions when multiple modules are configured. ↓
fix Ensure each module's mountPath is unique to avoid route conflicts.
gotcha Configuration options like configFile, workspaceConfigFile are relative to the UI5 app root, not the consumer project. ↓
fix Place referenced files inside the UI5 app's directory.
breaking The 'default' workspace lookup changed in UI5 CLI V3; ensure workspaceName matches the workspace defined in the UI5 app. ↓
fix Set workspaceName explicitly in the middleware configuration if the default workspace is not 'default'.
Install
npm install ui5-middleware-ui5 yarn add ui5-middleware-ui5 pnpm add ui5-middleware-ui5 Quickstart
// Install the middleware as dev dependency
npm install ui5-middleware-ui5 --save-dev
// In your ui5.yaml (specVersion: "3.0"), add the middleware configuration:
// server:
// customMiddleware:
// - name: ui5-middleware-ui5
// afterMiddleware: compression
// configuration:
// modules:
// my-ui5-app:
// mountPath: "/myapp"
//
// The moduleId "my-ui5-app" must be the name of a npm dependency containing a UI5 app.
// Then start your server with:
ui5 serve