Registry / web-framework / prember-middleware

prember-middleware

JSON →
library0.1.0jsnpmunverified

prember-middleware is an Ember CLI addon designed to facilitate the testing of pre-rendered Ember applications during local development. It provides an `ember-cli` middleware that correctly serves statically pre-rendered HTML files (e.g., `about/index.html` for the `/about` route) from the `dist` directory when running `ember serve`. This is crucial because `ember serve` typically expects dynamic rendering. The package is currently at version 0.1.0, with its last known update around 2017. Given its low version number and explicit Node.js engine constraints (`6.* || >= 7.*`), it is considered abandoned. While the core `prember` addon is actively maintained (last published July 2024, v6.0.0), `prember-middleware` itself has not seen updates. Its primary differentiator is enabling a development environment that mirrors `prember`'s production output without requiring a separate static file server. It integrates directly into the `ember-cli` build pipeline, leveraging Express middleware.

npm install prember-middleware
INSTALL
IMPORT
SIG · PREMBER-MIDDLEWARE
P
prember-middleware
web-frameworkjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs the `prember-middleware` addon and demonstrates how to activate it during `ember serve` using an environment variable, allowing local testing of pre-rendered routes.

ember install prember-middleware # Run your Ember app with prember-middleware enabled # This tells ember-cli to use the prember output for routes PREMBER=true ember serve # Example of prember configuration in ember-cli-build.js (for prember, not prember-middleware itself) // This configures the actual pre-rendering process // let app = new EmberApp(defaults, { // prember: { // urls: [ // '/', // '/about', // '/contact' // ], // enabled: true // Ensure prember runs even in development if needed, though usually for production // } // });
Debug
Known issues
breakingThe package requires Node.js versions 6.* or >= 7.*, which are long End-of-Life and unsupported. Running this addon with modern Node.js versions (e.g., Node 18+ or 20+) is highly likely to cause compatibility issues or runtime errors.
fix
Upgrade to a maintained middleware solution compatible with modern Ember CLI and Node.js versions. If no direct replacement exists, consider a custom `ember-cli-build.js` server middleware using Express directly or a simple static file server for testing prember output.
affects: <=0.1.0
gotchaThis addon is at version 0.1.0 and has not been updated since 2017. It is effectively abandoned, meaning no further bug fixes, security patches, or compatibility updates for newer Ember CLI or Node.js versions will be provided.
fix
Evaluate if the functionality is strictly necessary. For new projects or upgrading existing ones, seek alternative, actively maintained solutions or implement the necessary server middleware manually within `ember-cli-build.js`.
affects: >=0.1.0
gotchaWhile `prember-middleware` handles serving pre-rendered files, integrating `prember` itself with Ember's modern build system, Embroider, requires specific explicit configuration in `ember-cli-build.js`. The implicit `postprocessTree` hook often used by older addons like `prember` is not supported by Embroider, potentially leading to pre-rendering issues if not configured correctly.
fix
Refer to the `prember` documentation regarding Embroider compatibility and ensure explicit configuration of the `prerender` function within `ember-cli-build.js`.
affects: >=0.1.0
Errors
Common errors & fixes
Error: The `engines.node` in `package.json` is not satisfied. Expected "6.* || >= 7.*" but got "X.Y.Z".
Attempting to install or run `prember-middleware` with a Node.js version outside its declared `engines.node` range.
fix
Use a Node.js version manager (e.g., `nvm`) to switch to a compatible Node.js version (e.g., Node 7.x or 8.x, if available and secure), or consider the addon abandoned and seek an alternative solution.
Error: Cannot GET /your-prember-route
The `prember-middleware` is not correctly configured or activated, or `prember` itself did not generate the static HTML files for the specified route.
fix
Ensure `PREMBER=true` is set when running `ember serve`. Verify that your `prember` configuration in `ember-cli-build.js` includes the desired URLs and that `prember` successfully runs during the build process to generate the static files.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
prember-middleware — npm install prember-middleware · libregistry