{"id":14819,"library":"prember","title":"Prember (Pre-Render Ember)","description":"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.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ef4/prember","tags":["javascript","ember-addon","fastboot","prerender"],"install":[{"cmd":"npm install prember","lang":"bash","label":"npm"},{"cmd":"yarn add prember","lang":"bash","label":"yarn"},{"cmd":"pnpm add prember","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Prember 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.","package":"ember-cli-fastboot","optional":false}],"imports":[{"note":"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.","wrong":"import { prember } from 'prember';","symbol":"Prember Configuration Object","correct":"let app = new EmberApp(defaults, { prember: { urls: ['/', '/about'] } });"},{"note":"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.","symbol":"prember.urls","correct":"prember: { urls: ['/', '/contact'] }"},{"note":"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.","symbol":"EmberApp Addon Options","correct":"let app = new EmberApp(defaults, { /* ... addon options ... */ });"}],"quickstart":{"code":"const EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n  let app = new EmberApp(defaults, {\n    // Configure prember to prerender specific URLs\n    prember: {\n      urls: [\n        '/',          // The root path\n        '/about',     // An example static page\n        '/products/1',// An example dynamic path (ensure it resolves correctly)\n        '/blog/latest',// Another example path\n        '/contact-us' // A more descriptive path\n      ]\n    }\n    // Other Ember CLI build options can go here\n  });\n\n  // Use `app.toTree()` to return the Broccoli tree for your app\n  return app.toTree();\n};\n\n// To install the addons:\n// npm install --save-dev ember-cli-fastboot prember\n\n// To build the prerendered app:\n// ember build --environment=production","lang":"javascript","description":"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."},"warnings":[{"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`.","message":"Dropped support for Node.js versions prior to 16.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update your Node.js environment to version 8 or higher. For versions >= 2.0.0, Node.js >= 16 is required.","message":"Dropped support for Node.js versions prior to 8.","severity":"breaking","affected_versions":">=1.1.0 <2.0.0"},{"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.","message":"Changes in how `config/fastboot.js` is applied.","severity":"breaking","affected_versions":">=2.0.0"},{"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.","message":"FastBoot instance recycling for long builds.","severity":"gotcha","affected_versions":">=2.1.0"},{"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).","message":"URLs not prerendering or showing incorrect content.","severity":"gotcha","affected_versions":"*"},{"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 `/`.","message":"Web server configuration for prerendered files.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"`ember-cli-fastboot` is not installed or configured correctly, or the Ember CLI build process failed to generate the necessary FastBoot assets.","error":"Error: Prember encountered an error during prerendering: No FastBoot manifest found"},{"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.","cause":"A module dependency required by your Ember app during FastBoot rendering is missing or not correctly bundled for the FastBoot environment.","error":"Build failed. The Broccoli Plugin 'Prember' failed with: Error: Cannot find module '...' "},{"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.","cause":"Attempting to run `prember` version 2.x.x (or higher) with an incompatible Node.js version.","error":"Node.js v14.x is not supported by prember@2.x.x"},{"fix":"Add an array of URLs to the `prember` configuration, e.g., `prember: { urls: ['/', '/my-page'] }`.","cause":"The `prember` configuration object in `ember-cli-build.js` does not specify any URLs to prerender.","error":"The 'prember' configuration option is missing 'urls'."}],"ecosystem":"npm"}