I migrated to angular 17.1. When I ran the app, I noticed error information about using fetch with httpClient for SSR.
NG02801: Angular detected that `HttpClient` is not configured to use `fetch` APIs. It's strongly recommended to enable `fetch` for applications that use Server-Side Rendering for better performance and compatibility. To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` call at the root of the application.
Application is not bootstrap by standalone component but I found only tutorials for that kind of apps. I put provideHttpClient(withFetch()),
to app.server.module.ts
and error disappeared.
Im not sure if it is a correct solution for application bootstraped by AppModule. Do you have better options?
If you look at HttpClientModule
source it's basically just a wrapper.
If you remove HttpClientModule
and instead add this to providers it should be fine.
provideHttpClient(withInterceptorsFromDi(), withFetch()),
I'm not sure, but I assume your solution is fine as well.