Registry / web-framework / ui5-middleware-serveframework

ui5-middleware-serveframework

JSON →
library3.8.0jsnpmunverified

This UI5 middleware, `ui5-middleware-serveframework`, integrates with the UI5 tooling to provide a local serving mechanism for the OpenUI5 or SAPUI5 framework. It automatically builds and caches the specified UI5 framework version (as defined in the project's `ui5.yaml`) into a local directory (`~/.ui5/ui5-middleware-serveframework` by default). Subsequent requests for the same UI5 version are then served directly from this local cache, significantly improving development server startup times and ensuring consistent, offline-capable environments by leveraging preload files and direct static file access. The current stable version, 3.7.1 (as of the last search results), indicates a healthy, community-driven project with regular updates. Its key differentiator is the ability to use a fully local, pre-built UI5 framework, offering benefits over relying on remote CDN sources or repeated on-the-fly compilation.

npm install ui5-middleware-serveframework
INSTALL
IMPORT
SIG · UI5-MIDDLEWARE-SER
U
ui5-middleware-serveframework
web-frameworkjavascriptv3.8.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package Installation
npm install ui5-middleware-serveframework --save-dev
npm install ui5-middleware-serveframework (missing --save-dev for a typical development-only middleware)
This middleware is typically installed as a development dependency for UI5 projects.
`package.json` devDependency entry
"devDependencies": { "ui5-middleware-serveframework": "^3.0.0" }
Missing the dependency, or an incorrect version range causing compatibility issues.
Ensure the middleware is listed in `devDependencies` with a compatible version range.
`ui5.yaml` Custom Middleware configuration
server: customMiddleware: - name: ui5-middleware-serveframework afterMiddleware: compression configuration: debug: true
Typo in the `name`, incorrect `afterMiddleware` placement, or misconfigured `configuration` options.
The middleware is activated and configured declaratively within the project's `ui5.yaml` file, typically after the `compression` middleware. This package does not expose JavaScript/TypeScript symbols for direct programmatic import in application code.

This quickstart outlines the essential `package.json` and `ui5.yaml` configurations required to integrate and utilize `ui5-middleware-serveframework`. It demonstrates setting up development dependencies and defines a `start` script to launch the UI5 development server, leveraging the middleware to serve a locally built UI5 framework version (e.g., OpenUI5 1.120.0).

// package.json (excerpt) { "name": "my-ui5-app", "version": "1.0.0", "private": true, "description": "A minimal UI5 app using ui5-middleware-serveframework", "devDependencies": { "@ui5/cli": "^3.0.0", "@ui5/builder": "^3.0.0", "@ui5/project": "^3.0.0", "ui5-middleware-serveframework": "^3.0.0" }, "scripts": { "start": "ui5 serve --config ui5.yaml" } } // ui5.yaml (create this file in your project root) # For documentation see: https://sap.github.io/ui5-tooling/pages/Configuration/ specVersion: "3.0" metadata: name: my.ui5.app type: application framework: name: OpenUI5 version: "1.120.0" # Specify your desired UI5 version here libraries: - name: sap.m - name: sap.ui.core server: customMiddleware: - name: ui5-middleware-serveframework afterMiddleware: compression configuration: debug: true saveLibsLocal: true # ui5VersionEnvVariable: UI5_VERSION # Uncomment to override version via env var # strictSSL: false # Uncomment to disable strict SSL checks if behind a proxy
Debug
Known issues
breakingAll releases of `ui5-middleware-serveframework` with major version `3` require `@ui5/cli@3.0.0` or higher to function correctly. Using incompatible versions will lead to runtime errors during development server startup or framework building.
fix
Ensure your project's `package.json` lists `@ui5/cli` with a version range compatible with `^3.0.0`. Also, verify that your `ui5.yaml` `specVersion` is set to `"3.0"`.
affects: >=3.0.0
gotchaBy default, the middleware caches built UI5 framework libraries in the user's home directory (`~/.ui5/ui5-middleware-serveframework`). While this saves disk space by sharing caches across projects, it can lead to longer initial build times for each new UI5 version encountered.
fix
To isolate cached libraries per project (useful for CI/CD or dedicated project environments), set `saveLibsLocal: true` in the middleware's configuration in `ui5.yaml`. You can also specify a custom `cachePath` if needed.
affects: >=1.0.0
gotchaIncorrect `afterMiddleware` placement in your `ui5.yaml` can disrupt the middleware's functionality or interact negatively with other server components. The documentation recommends placing it after the `compression` middleware.
fix
Always configure `afterMiddleware: compression` for `ui5-middleware-serveframework` in your `ui5.yaml` to ensure proper integration with the UI5 development server's middleware chain.
affects: >=1.0.0
gotchaIf operating behind a corporate proxy with self-signed SSL certificates, the framework's build process might fail due to strict SSL checks when attempting to download UI5 resources. The `strictSSL` option defaults to `true`.
fix
Set `strictSSL: false` in the middleware's configuration within `ui5.yaml` to disable strict SSL validation. Exercise caution as this can reduce security in certain network environments.
affects: >=1.0.0
gotchaThere have been reported issues where `ui5-middleware-serveframework` can interfere with `ui5-test-runner`, causing tests to fail or run prematurely.
fix
Check for updates to `ui5-test-runner` as this issue might be resolved in newer versions (e.g., `ui5-test-runner` version 5.3.7 was mentioned as fixing a related issue). If the problem persists, consider temporarily disabling `ui5-middleware-serveframework` or isolating testing environments.
affects: >=3.0.0
Errors
Common errors & fixes
Error: ui5-middleware-serveframework: Could not find @ui5/cli version 3.x in project dependencies.
The project is using an older version of `@ui5/cli` (e.g., v2) while `ui5-middleware-serveframework` v3+ requires `@ui5/cli` v3+.
fix
Update your `@ui5/cli` dependency to `^3.0.0` or higher in `package.json` and ensure `ui5.yaml`'s `specVersion` is set to `"3.0"`.
ERR_CERT_AUTHORITY_INVALID (or similar SSL certificate errors during framework build)
The middleware is trying to download UI5 resources from a CDN over HTTPS but fails due to strict SSL checks against a self-signed or untrusted corporate proxy certificate.
fix
Add `strictSSL: false` to the `ui5-middleware-serveframework` configuration in your `ui5.yaml` file to bypass SSL certificate validation for development purposes.
UI5 server starts, but UI5 resources (e.g., `sap/m/library.js`) are not found or return 404.
The middleware is not correctly configured in `ui5.yaml` or a compatible UI5 framework version cannot be built/found for the project.
fix
Verify that `ui5-middleware-serveframework` is correctly listed under `server.customMiddleware` in `ui5.yaml` with `afterMiddleware: compression`. Ensure the `framework` section in `ui5.yaml` correctly specifies `name` and `version` (e.g., `OpenUI5` and a valid version like `1.120.0`), and that `@ui5/builder` and `@ui5/project` are present in `devDependencies`.
Upgrade
Version history
3.8.0latest on npm
Audit
Dependencies
@ui5/builderrequiredRequired for building the UI5 framework locally into the cache.
@ui5/projectrequiredRequired for project configuration parsing and UI5 framework version detection.
@ui5/clirequiredPeer dependency; major version 3 of this middleware requires UI5 CLI V3.
Agent activity
2 hits · last 30 days
node
2
Resources
ui5-middleware-serveframework — npm install ui5-middleware-serveframework · libregistry