Registry / web-framework / prember

prember

JSON →
library2.1.0jsnpmunverified

Prember is an Ember CLI addon designed to pre-render Ember applications into static HTML files during the build process, leveraging Ember FastBoot. This transforms a dynamic Ember app into a progressive static-site, enhancing initial page load performance and SEO for specified routes. The current stable version is 2.1.0, with minor updates released periodically and significant breaking changes typically reserved for major version bumps. Key differentiators include its 100% Ember-centric development experience, data agnosticism allowing any data source, instant navigation post-hydration, and full support for modern Ember features like Embroider. It addresses the common challenge of providing fast first-contentful-paint and SEO benefits without requiring a server-side rendering (SSR) runtime in the critical path at deployment.

npm install prember
INSTALL
IMPORT
SIG · PREMBER
P
prember
web-frameworkjavascriptv2.1.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

Prember Configuration Object
✓ let app = new EmberApp(defaults, { prember: { urls: ['/', '/about'] } });
✗ import { prember } from 'prember';
Prember is an Ember CLI addon. Its functionality is primarily configured via a `prember` key within the options object passed to the `EmberApp` constructor in `ember-cli-build.js`. Direct JavaScript `import` or `require` statements for symbols from `prember` are not used in application code.
prember.urls
✓ prember: { urls: ['/', '/contact'] }
The `urls` property within the `prember` configuration object defines the specific routes that Prember should prerender. This is the most common way to specify static pages. The value should be an array of strings representing paths.
EmberApp Addon Options
✓ let app = new EmberApp(defaults, { /* ... addon options ... */ });
Prember is enabled and configured by including its options directly within the `EmberApp` constructor's second argument (the options object) in `ember-cli-build.js`. This is the standard pattern for Ember CLI addon configuration.

This quickstart demonstrates how to install `prember` and configure it in `ember-cli-build.js` to prerender a list of specified URLs during a production build.

const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function(defaults) { let app = new EmberApp(defaults, { // Configure prember to prerender specific URLs prember: { urls: [ '/', // The root path '/about', // An example static page '/products/1',// An example dynamic path (ensure it resolves correctly) '/blog/latest',// Another example path '/contact-us' // A more descriptive path ] } // Other Ember CLI build options can go here }); // Use `app.toTree()` to return the Broccoli tree for your app return app.toTree(); }; // To install the addons: // npm install --save-dev ember-cli-fastboot prember // To build the prerendered app: // ember build --environment=production
Debug
Known issues
breakingDropped support for Node.js versions prior to 16.
fix
Ensure your Node.js environment is version 16 or higher. Update Node.js using `nvm install 16` or similar version manager, then `nvm use 16`.
affects: >=2.0.0
breakingDropped support for Node.js versions prior to 8.
fix
Update your Node.js environment to version 8 or higher. For versions >= 2.0.0, Node.js >= 16 is required.
affects: >=1.1.0 <2.0.0
breakingChanges in how `config/fastboot.js` is applied.
fix
Review your `config/fastboot.js` file and ensure its configuration aligns with how `ember-cli-fastboot` applies it, as Prember v2.0.0 now follows the same methodology. This may affect service worker registrations or global FastBoot configuration.
affects: >=2.0.0
gotchaFastBoot instance recycling for long builds.
fix
Prember now recycles the FastBoot instance after 1000 requests to mitigate potential memory leaks during very large prerendering builds. While generally an enhancement, monitor memory usage for extremely complex routes or very large numbers of prerendered URLs, as edge cases might still exist depending on app complexity.
affects: >=2.1.0
gotchaURLs not prerendering or showing incorrect content.
fix
Verify that the URLs specified in `prember.urls` are valid routes in your Ember application and are accessible via FastBoot. Ensure any dynamic data needed for those routes is available during the build process (e.g., through static mocks or data available at build time).
affects: *
gotchaWeb server configuration for prerendered files.
fix
After building, configure your web server (e.g., Nginx, Apache, Netlify) to correctly serve the prerendered `index.html` files for the specified paths (e.g., `/about` should serve `dist/about/index.html`). The default `index.html` in `dist/` becomes `_empty.html` and a new `index.html` at the root contains the prerendered content for `/`.
affects: *
Errors
Common errors & fixes
Error: Prember encountered an error during prerendering: No FastBoot manifest found
`ember-cli-fastboot` is not installed or configured correctly, or the Ember CLI build process failed to generate the necessary FastBoot assets.
fix
Ensure `ember-cli-fastboot` is installed (`npm install --save-dev ember-cli-fastboot`) and that your Ember app builds successfully with FastBoot enabled before attempting a Prember build.
Build failed. The Broccoli Plugin 'Prember' failed with: Error: Cannot find module '...'
A module dependency required by your Ember app during FastBoot rendering is missing or not correctly bundled for the FastBoot environment.
fix
Check your `package.json` for missing `dependencies` (not `devDependencies`), especially for modules used in `app/initializers` or `app/instance-initializers`. Ensure any Node.js-specific dependencies are correctly configured for FastBoot or mocked if they are browser-only.
Node.js v14.x is not supported by prember@2.x.x
Attempting to run `prember` version 2.x.x (or higher) with an incompatible Node.js version.
fix
Upgrade your Node.js version to 16 or higher (`nvm install 16 && nvm use 16`) as `prember` v2.x.x requires Node.js >= 16.
The 'prember' configuration option is missing 'urls'.
The `prember` configuration object in `ember-cli-build.js` does not specify any URLs to prerender.
fix
Add an array of URLs to the `prember` configuration, e.g., `prember: { urls: ['/', '/my-page'] }`.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
ember-cli-fastbootrequiredPrember builds on Ember FastBoot to perform the server-side rendering during the build. `ember-cli-fastboot` is required to make the Ember app FastBoot-compatible.
Agent activity
8 hits · last 30 days
node
8
Resources
prember — npm install prember · libregistry