Registry /
web-framework / ui5-middleware-servestatic
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import middleware from 'ui5-middleware-servestatic'
✗ const middleware = require('ui5-middleware-servestatic')
ESM is preferred, but CJS require also works as the package exports both.
serveStatic
✓ import { serveStatic } from 'ui5-middleware-servestatic'
✗ import serveStatic from 'ui5-middleware-servestatic'
Named export for the core serveStatic function, used for custom integrations.
middleware
✓ import { middleware } from 'ui5-middleware-servestatic'
✗ Import the default export and use it as middleware.
The package exports a `middleware` named export as well.
Shows installation, configuration in ui5.yaml, and programmatic usage of the middleware with Express.
// Install: npm install ui5-middleware-servestatic --save-dev
// In ui5.yaml:
// server:
// customMiddleware:
// - name: ui5-middleware-servestatic
// afterMiddleware: compression
// mountPath: /resources
// configuration:
// rootPath: /path/to/static/resources
// Implementation example:
import express from 'express';
import { middleware } from 'ui5-middleware-servestatic';
const app = express();
app.use('/resources', middleware({
rootPath: '/path/to/static/resources',
debug: true
}));
app.listen(3000, () => console.log('Server running on port 3000'));
Errors
Common errors & fixes
Cannot find module 'ui5-middleware-servestatic'
Package not installed or not in node_modules.
fixRun `npm install ui5-middleware-servestatic --save-dev`.
ERROR #UI5/00012: Middleware 'ui5-middleware-servestatic' not found
UI5 CLI cannot locate the middleware in ui5.yaml dependencies.
fixEnsure the package is listed in devDependencies and npm install succeeded.
TypeError: Cannot read properties of undefined (reading 'rootPath')
Configuration object missing in ui5.yaml under the middleware entry.
fixAdd `configuration: { rootPath: '...' }` to your middleware definition. Audit
Dependencies
@ui5/clirequiredRequired at version 3.0.0+ for specVersion 3.0 support
serve-staticrequiredUsed internally to serve static files