diff --git a/README.md b/README.md index c5d8175..7a7ddb9 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,14 @@ export class DemoComponent { } ``` +## Known Issues +* **Headers are not forwarded when performing requests in ssr.** + + _Add this provider to your `app.config.server.ts` file to fix this issue:_ + ```typescript + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ``` + ## TODOs 📝 - [ ] Additional Unit Tests for SSR and WebSocket Subscriptions. diff --git a/angular.json b/angular.json index 2fea3da..1fbd5e6 100644 --- a/angular.json +++ b/angular.json @@ -69,7 +69,7 @@ ], "scripts": [], "server": "projects/example/src/main.server.ts", - "outputMode": "server", + "externalDependencies": [""], "ssr": { "entry": "projects/example/src/server.ts" } diff --git a/projects/example/src/app/app.config.server.ts b/projects/example/src/app/app.config.server.ts index ddd0d86..453274f 100644 --- a/projects/example/src/app/app.config.server.ts +++ b/projects/example/src/app/app.config.server.ts @@ -1,9 +1,13 @@ import {ApplicationConfig, mergeApplicationConfig} from '@angular/core'; import {provideServerRendering} from '@angular/platform-server'; import {appConfig} from './app.config'; +import {provideServerRoutesConfig, RenderMode} from '@angular/ssr'; const serverConfig: ApplicationConfig = { - providers: [provideServerRendering()] + providers: [ + provideServerRendering(), + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ] }; export const config = mergeApplicationConfig(appConfig, serverConfig); diff --git a/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts b/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts index c2b8ed8..0ec39a0 100644 --- a/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts +++ b/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts @@ -24,4 +24,4 @@ export interface TRPCSubscriptionObserver { onComplete: () => void; } -export type YieldType = T extends AsyncGenerator ? Y : never; +export type YieldType = inferAsyncIterableYield;