What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Angular’s NG0401 “Missing Platform” error usually means the server-side bootstrap calls bootstrapApplication without the BootstrapContext Angular requires for server-side rendering. Accept the context in your server bootstrap function and pass it as the third argument to bootstrapApplication. The example below shows the change; keep your project’s existing component and configuration paths.
What NG0401 means
Angular documents NG0401 for server-side use of bootstrapApplication without a BootstrapContext. That context carries a pre-existing platform injector through its platformRef property. In server-side rendering (SSR), Angular’s server platform API describes creating a platform for the request and supplying it to the bootstrap call through the context.
The Angular NG0401 error reference identifies the missing context as the issue. It does not publish a frequency or impact statistic for the error.
Fix the server bootstrap function
In main.server.ts or your equivalent server entry point, accept the context supplied by the SSR caller and forward it as the third argument:
#1 Best Overall
import {bootstrapApplication, BootstrapContext} from '@angular/platform-browser';
import {App} from './app/app';
import {config} from './app/app.config.server';
const bootstrap = (context: BootstrapContext) => bootstrapApplication(App, config, context);
export default bootstrap;
The significant change is the context parameter and passing it to bootstrapApplication. Use your application’s actual root component and server configuration imports; the sample paths are illustrative. See Angular’s error guidance and bootstrapApplication API.
Check the right bootstrap path
- Confirm the failing entry point. NG0401’s documented case is server-side bootstrap, so check the SSR path rather than changing the browser entry point.
- Inspect the server entry point. Find
main.server.tsor the equivalent function that exports the server bootstrap. Check whether it receives aBootstrapContext. - Forward the context. Pass that value as the third argument to
bootstrapApplication, retaining the root component and server application configuration your project already uses. - Check direct platform setup if applicable. If your code calls Angular’s server-platform API directly, make sure it creates the server platform and supplies it through the context. Angular documents this flow in the platformServer API and the BootstrapContext API.
If your application uses NgModules
Do not apply the standalone SSR example blindly if the application bootstraps an NgModule. Angular documents module-based applications using bootstrapModule with platformBrowser or platformServer; its NgModule guide recommends bootstrapApplication for new code. First identify the API your application actually uses, then follow the relevant setup in Angular’s NgModules guide.
Rank #2
| Application shape | Bootstrap API | What to check for SSR |
|---|---|---|
| Standalone application | bootstrapApplication |
For the documented NG0401 case, the server bootstrap receives and forwards BootstrapContext. |
| Existing NgModule application | bootstrapModule |
Follow the module-based server setup; the standalone context example is not a drop-in replacement. |
What not to change for this error
Adding application-level providers, including hydration providers, is not the specific NG0401 repair. Angular’s error reference calls for passing BootstrapContext. Hydration is a separate SSR configuration concern and can be set up independently.
Recommended Free Tools
Check your Angular version and generated files
Angular’s error reference and API pages are live documentation and do not pin the NG0401 guidance to a specific release in the cited material. The bootstrapApplication and BootstrapContext APIs are described as stable. Before editing, check the Angular version installed in your project and the SSR entry files it generated; retain the project’s existing component and configuration structure.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

