fix(ssr): bootstrap standalone app for CommonEngine
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Passing EnvironmentProviders via CommonEngine StaticProvider[] dropped provideZoneChangeDetection, causing ZoneStablePendingTask2 on render. Use bootstrapApplication + mergeApplicationConfig instead.
This commit is contained in:
1 parent
0b82cbb25f
commit
0a30980105
5 files changed
+34
-36
No files matched your search
@@ -5,7 +5,7 @@ import { CommonEngine } from '@angular/ssr/node';
|
||||
import express from 'express';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import AppServerModule from './src/main.server';
|
||||
import bootstrap from './src/main.server';
|
||||
|
||||
const STRAVA_API_BASE = 'https://www.strava.com/api/v3';
|
||||
const FACEIT_API_BASE = 'https://open.faceit.com';
|
||||
@@ -230,11 +230,8 @@ export function app(): express.Express {
|
||||
|
||||
commonEngine
|
||||
.render({
|
||||
bootstrap: AppServerModule.bootstrap,
|
||||
providers: [
|
||||
...AppServerModule.providers,
|
||||
{ provide: APP_BASE_HREF, useValue: baseUrl },
|
||||
] as unknown as import('@angular/core').StaticProvider[],
|
||||
bootstrap,
|
||||
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
||||
documentFilePath: indexHtml,
|
||||
url: `${protocol}://${headers.host}${originalUrl}`,
|
||||
publicPath: distFolder,
|
||||
@@ -262,4 +259,4 @@ if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
|
||||
run();
|
||||
}
|
||||
|
||||
export default AppServerModule.bootstrap;
|
||||
export default bootstrap;
|
||||
Reference in new issue
Block a user