Skip to content

ng serve warning: Angular detected an incompatible configuration, which causes duplicate serialization of the server-side application state.Β #63524

@anisabboud

Description

@anisabboud

Which @angular/* package(s) are the source of the bug?

platform-server

Is this a regression?

Yes

Description

I occassionally see this warning in the terminal when running ng serve (Angular 20.1.x and latest 20.2.0).

Image

The warning doesn't seem to cause harm but the source of the issue is not very clear, since we don't have ServerModule anywhere in the code, and our app.config.server.ts is the standard/simple:

import { ApplicationConfig, mergeApplicationConfig } from '@angular/core';
import { provideServerRendering } from '@angular/ssr';
import { appConfig } from 'app/app.config';

const serverConfig: ApplicationConfig = {
  providers: [
    provideServerRendering()
  ]
};

export const config = mergeApplicationConfig(appConfig, serverConfig);

Could you please provide additional clarification / tips for resolving this warning?

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Angular detected an incompatible configuration, which causes duplicate serialization of the server-side application state.

This can happen if the server providers have been provided more than once using different mechanisms. For example:

  imports: [ServerModule], // Registers server providers
  providers: [provideServerRendering()] // Also registers server providers

To fix this, ensure that the `provideServerRendering()` function is the only provider used and remove the other(s).

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 20.2.0
Node: 22.16.0
Package Manager: npm 11.5.2
OS: linux x64


Angular: 20.2.0
... build, cdk, cli, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker, ssr, youtube-player

Package                      Version
------------------------------------
@angular-devkit/architect    0.2002.0
@angular-devkit/core         20.2.0
@angular-devkit/schematics   20.2.0
@angular/fire                20.0.1
@schematics/angular          20.2.0
rxjs                         7.8.2
typescript                   5.9.2

Anything else?

The warning originates from 300b141

if (appIdsWithTransferStateSerialized.has(appId)) {
console.warn(
`Angular detected an incompatible configuration, which causes duplicate serialization of the server-side application state.\n\n` +
`This can happen if the server providers have been provided more than once using different mechanisms. For example:\n\n` +
` imports: [ServerModule], // Registers server providers\n` +
` providers: [provideServerRendering()] // Also registers server providers\n\n` +
`To fix this, ensure that the \`provideServerRendering()\` function is the only provider used and remove the other(s).`,
);
}

It often coincides with [vite] (ssr) ✨ new dependencies optimized.
Image

When stopping the server via Ctrl+C and re-running ng serve, the warning is gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: serverIssues related to server-side renderingregressionIndicates than the issue relates to something that worked in a previous version

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions