{"id":25990,"library":"ngx-fastboot","title":"ngx-fastboot","description":"ngx-fastboot is an Angular library for dynamically loading configuration at runtime, optimizing startup performance by lazy-loading providers. The current stable version is 2.1.0, released February 2025. It requires Angular 19 and Node >=20.10.0. Key differentiators: unlike typical static environment files, ngx-fastboot allows configurations to be loaded asynchronously via HTTP or custom sources and bundled into a separate chunk for faster initial loads. It provides fastBootstrapApplication, withProviders, and lazyRootComponent helpers. The library ships TypeScript types and follows Angular's standalone component pattern.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/KernelPanic92/ngx-fastboot","tags":["javascript","angular","boot","lazy","configuration","providers","dynamic","performance","fastboot","typescript"],"install":[{"cmd":"npm install ngx-fastboot","lang":"bash","label":"npm"},{"cmd":"yarn add ngx-fastboot","lang":"bash","label":"yarn"},{"cmd":"pnpm add ngx-fastboot","lang":"bash","label":"pnpm"}],"dependencies":null,"imports":[{"note":"Named export, not default.","wrong":"import fastBootstrapApplication from 'ngx-fastboot';","symbol":"fastBootstrapApplication","correct":"import { fastBootstrapApplication } from 'ngx-fastboot';"},{"note":"CamelCase with lowercase 'w'.","wrong":"import { WithProviders } from 'ngx-fastboot';","symbol":"withProviders","correct":"import { withProviders } from 'ngx-fastboot';"},{"note":"CamelCase with lowercase 'l'.","wrong":"import { LazyRootComponent } from 'ngx-fastboot';","symbol":"lazyRootComponent","correct":"import { lazyRootComponent } from 'ngx-fastboot';"},{"note":"Use type import to avoid runtime overhead.","wrong":"import { AppConfig } from 'ngx-fastboot';","symbol":"type AppConfig","correct":"import type { AppConfig } from 'ngx-fastboot';"}],"quickstart":{"code":"import { fastBootstrapApplication, withProviders } from 'ngx-fastboot';\nimport { provideHttpClient } from '@angular/common/http';\nimport { AppComponent } from './app.component';\n\n// Config loader factory - must return a promise of providers\nconst configProviders = () =>\n  fetch('/config.json').then(res => res.json()).then(config => [\n    { provide: 'APP_CONFIG', useValue: config },\n  ]);\n\n// Bootstrap\nfastBootstrapApplication(AppComponent, {\n  providers: [\n    provideHttpClient(),\n    withProviders(configProviders), // lazy-loaded providers\n  ],\n});","lang":"typescript","description":"Bootstraps an Angular app with lazy configuration loaded via HTTP. Uses fastBootstrapApplication and withProviders to defer config providers."},"warnings":[{"fix":"Upgrade to Angular 19 or stay on v1.x for Angular 18 support.","message":"Angular 18 no longer supported in v2.0.0","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use fastBootstrapApplication instead of bootstrapApplication when using ngx-fastboot.","message":"v2.0.0 replaced bootstrapApplication with fastBootstrapApplication. Old API no longer works.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use withProviders instead of provideFastBoot.","message":"withProviders was renamed from provideFastBoot in older versions; the old name is deprecated.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Wrap config loader in withProviders() and include in providers array.","message":"fastBootstrapApplication expects providers array with withProviders, not a direct call. If you forget withProviders, config won't load.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure config loader functions are passed to withProviders, not called directly in providers array.","cause":"Attempting to use inject() outside of an injection context, e.g., in a factory function not called by Angular.","error":"Error: NG0203: inject() must be called from an injection context"},{"fix":"Use withProviders to load config before app bootstrap, and handle fetch errors.","cause":"The configuration was not loaded when component tried to inject APP_CONFIG, likely because withProviders was not used or the config loading failed.","error":"Error: No provider for InjectionToken APP_CONFIG"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}