Repository: angular
Issue: Unable to hydrate App - Angular 17, Standalone using Ionic
Labels: area: core,core: hydration

### Which @angular/* package(s) are the source of the bug?

Don't known / other

### Is this a regression?

Yes

### Description

I create an app with "ng new --ssr", I added some libraries as "ionic" and was trying to set it up with ssr.

So If I test aplicacion on local with "ionic serve", it uses architect "app:serve".

When I go to see the App localy I ended up with this warning:

> NG0505: Angular hydration was requested on the client, but there was no serialized information present in the server response, thus hydration was not enabled. Make sure the `provideClientHydration()` 
![Captura de pantalla 2024-01-21 a la(s) 14 45 49](https://github.com/angular/angular/assets/36543775/cb9c6886-5975-43e3-9694-f8590d682318)


So i deactivate using "provideClientHydration", so it looks fine on local
<img width="1634" alt="Captura de pantalla 2024-01-21 a la(s) 15 24 50" src="https://github.com/angular/angular/assets/36543775/6c9f0182-52e5-462a-98f4-e0e5a3b02bbc">

But, when I try to do "ionic build", which uses "app:build", I got the static version which looks clearly different, that´s because shado dom is not added. I´ve also tried activating or deactivating but got any difference.  (https://foodjourney.app/welcome)

My actual package looks like this:
`{
  "name": "food-journey",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lint": "ng lint",
    "dev:ssr": "ng run app:serve-ssr",
    "serve:ssr": "node dist/app/server/main.js",
    "build:ssr": "ng build && ng run app:server",
    "prerender": "ng run app:prerender"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^17.1.0",
    "@angular/common": "^17.1.0",
    "@angular/compiler": "^17.1.0",
    "@angular/core": "^17.1.0",
    "@angular/fire": "^17.0.1",
    "@angular/forms": "^17.1.0",
    "@angular/google-maps": "^17.1.0",
    "@angular/platform-browser": "^17.1.0",
    "@angular/platform-browser-dynamic": "^17.1.0",
    "@angular/platform-server": "^17.1.0",
    "@angular/router": "^17.1.0",
    "@angular/ssr": "^17.1.0",
    "@capacitor-community/apple-sign-in": "^5.0.0",
    "@capacitor/android": "5.6.0",
    "@capacitor/app": "5.0.6",
    "@capacitor/core": "5.6.0",
    "@capacitor/geolocation": "^5.0.6",
    "@capacitor/haptics": "5.0.6",
    "@capacitor/ios": "5.6.0",
    "@capacitor/keyboard": "5.0.7",
    "@capacitor/network": "^5.0.6",
    "@capacitor/preferences": "^5.0.6",
    "@capacitor/splash-screen": "^5.0.6",
    "@capacitor/status-bar": "^5.0.6",
    "@codetrix-studio/capacitor-google-auth": "^3.3.6",
    "@ionic/angular": "^7.5.0",
    "@ionic/angular-server": "^7.6.3",
    "express": "^4.18.2",
    "ionicons": "^7.2.1",
    "moment-timezone": "^0.5.44",
    "ng2-pdf-viewer": "^10.0.0",
    "onesignal-cordova-plugin": "^5.0.4",
    "onesignal-ngx": "^2.0.1",
    "rxjs": "~7.8.0",
    "swiper": "^11.0.5",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^17.1.0",
    "@angular-eslint/builder": "^17.2.0",
    "@angular-eslint/eslint-plugin": "^17.2.0",
    "@angular-eslint/eslint-plugin-template": "^17.2.0",
    "@angular-eslint/schematics": "^17.2.0",
    "@angular-eslint/template-parser": "^17.2.0",
    "@angular/cli": "^17.1.0",
    "@angular/compiler-cli": "^17.1.0",
    "@angular/language-service": "^17.1.0",
    "@capacitor/cli": "5.6.0",
    "@ionic/angular-toolkit": "^9.0.0",
    "@types/express": "^4.17.17",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^18.18.0",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "browser-sync": "^3.0.0",
    "eslint": "^7.26.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~5.1.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "ts-node": "^8.3.0",
    "typescript": "~5.2.2"
  },
  "description": "An Ionic project"
}
`

My angular.json like this:
```
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "app": {
      "projectType": "application",
      "schematics": {
        "@ionic/angular-toolkit:page": {
          "styleext": "scss",
          "standalone": true
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/app/browser",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "inlineStyleLanguage": "scss",
            "assets": [
              {
                "glob": "**/*",
                "input": "src/.well-known",
                "output": ".well-known/"
              },
              {
              "glob": "**/*",
              "input": "src/assets",
              "output": "assets"
            }, {
              "glob": "**/*.svg",
              "input": "node_modules/ionicons/dist/ionicons/svg",
              "output": "./svg"
            },
            "src/OneSignalSDKWorker.js"],
            "styles": [
              "src/theme/variables.scss",
              "src/global.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "budgets": [{
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "12kb"
                }
              ],
              "fileReplacements": [{
                "replace": "src/environments/environment.ts",
                "with": "src/environments/environment.prod.ts"
              }],
              "outputHashing": "all"
            },
            "development": {
              "buildOptimizer": false,
              "optimization": false,
              "vendorChunk": true,
              "extractLicenses": false,
              "sourceMap": true,
              "namedChunks": true
            },
            "ci": {
              "progress": false
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "buildTarget": "app:build:production"
            },
            "development": {
              "buildTarget": "app:build:development"
            },
            "ci": {
              "progress": false
            }
          },
          "defaultConfiguration": "development"
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "buildTarget": "app:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "inlineStyleLanguage": "scss",
            "assets": [{
              "glob": "**/*",
              "input": "src/assets",
              "output": "assets"
            }],
            "styles": [
              "src/theme/variables.scss",
              "src/global.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "ci": {
              "progress": false,
              "watch": false
            }
          }
        },
        "lint": {
          "builder": "@angular-eslint/builder:lint",
          "options": {
            "lintFilePatterns": [
              "src/**/*.ts",
              "src/**/*.html"
            ]
          }
        },
        "server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist/app/server",
            "main": "server.ts",
            "tsConfig": "tsconfig.server.json",
            "inlineStyleLanguage": "scss",
            "externalDependencies": ["canvas"]
          },
          "configurations": {
            "production": {
              "outputHashing": "media",
              "fileReplacements": [{
                "replace": "src/environments/environment.ts",
                "with": "src/environments/environment.prod.ts"
              }]
            },
            "development": {
              "buildOptimizer": false,
              "optimization": false,
              "sourceMap": true,
              "extractLicenses": false,
              "vendorChunk": true
            },
            "ci": {}
          },
          "defaultConfiguration": "production"
        },
        "serve-ssr": {
          "builder": "@angular-devkit/build-angular:ssr-dev-server",
          "configurations": {
            "development": {
              "browserTarget": "app:build:development",
              "serverTarget": "app:server:development"
            },
            "production": {
              "browserTarget": "app:build:production",
              "serverTarget": "app:server:production"
            }
          },
          "defaultConfiguration": "development"
        },
        "prerender": {
          "builder": "@angular-devkit/build-angular:prerender",
          "options": {
            "routes": [
              "/"
            ]
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production",
              "serverTarget": "app:server:production"
            },
            "development": {
              "browserTarget": "app:build:development",
              "serverTarget": "app:server:development"
            }
          },
          "defaultConfiguration": "production"
        },
        "deploy": {
          "builder": "@angular/fire:deploy",
          "options": {
            "version": 2
          },
          "configurations": {
            "production": {
              "buildTarget": "app:build:production",
              "serveTarget": "app:serve-ssr:production"
            },
            "development": {
              "buildTarget": "app:build:development",
              "serveTarget": "app:serve-ssr:development"
            }
          },
          "defaultConfiguration": "production"
        }
      }
    }
  },
  "cli": {
    "schematicCollections": [
      "@ionic/angular-toolkit"
    ],
    "analytics": "6f4fd7d6-33a5-491c-8a1b-1ea861963393"
  },
  "schematics": {
    "@ionic/angular-toolkit:component": {
      "styleext": "scss"
    },
    "@ionic/angular-toolkit:page": {
      "styleext": "scss"
    },
    "@angular-eslint/schematics:application": {
      "setParserOptionsProject": true
    },
    "@angular-eslint/schematics:library": {
      "setParserOptionsProject": true
    }
  }
}
```

My app.config.ts:
``` 
import { RouteReuseStrategy, TitleStrategy, provideRouter, withComponentInputBinding, withRouterConfig } from '@angular/router';
import { ApplicationConfig, importProvidersFrom } from '@angular/core';

import { IonicRouteStrategy } from '@ionic/angular/common';
import { provideIonicAngular } from '@ionic/angular/standalone';
import { routes } from './app.routes';

import {
    ScreenTrackingService,
    UserTrackingService,
    getAnalytics,
    provideAnalytics,
} from '@angular/fire/analytics';
import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { getAuth, provideAuth } from '@angular/fire/auth';
import { getFirestore, provideFirestore } from '@angular/fire/firestore';
import { getPerformance, providePerformance } from '@angular/fire/performance';
import { getStorage, provideStorage } from '@angular/fire/storage';
import { environment } from '../environments/environment';
import { FIREBASE_OPTIONS } from '@angular/fire/compat';
import { provideHttpClient } from '@angular/common/http';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideClientHydration } from '@angular/platform-browser';

export const appConfig: ApplicationConfig = {
    providers: [
        { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
        provideIonicAngular({
            mode: "ios",
            backButtonText: "",
            backButtonIcon: "chevron-back",
        }),
        
        provideRouter(routes, withComponentInputBinding()),
        provideClientHydration(),
        provideAnimations(),
        importProvidersFrom([
            provideFirebaseApp(() => initializeApp(environment.firebase)),
            provideAnalytics(() => getAnalytics()),
            provideAuth(() => getAuth()),
            provideFirestore(() => getFirestore()),
            providePerformance(() => getPerformance()),
            provideStorage(() => getStorage()),
        ]),
        provideHttpClient(),
        { provide: FIREBASE_OPTIONS, useValue: environment.firebase },
        ScreenTrackingService,
        UserTrackingService,

    ],
};``` 



### Please provide a link to a minimal reproduction of the bug

https://foodjourney.app/welcome

### Please provide the exception or error you saw

```true
No "hydrated" is added. If I use provideClientHydration I got warnings but there is no difference with the final build.
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI 17.1.0
macOS X 
NodeJS 18.18
```


### Anything else?

_No response_