Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 8f47c59

Browse files
committed
fix(@nguniversal/builders): address method Promise.prototype.then called on incompatible receiver error
Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js. (cherry picked from commit b7dbc25)
1 parent 691e2fe commit 8f47c59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/builders/src/prerender/worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export async function render({
4141
const outputFolderPath = path.join(outputPath, route);
4242
const outputIndexPath = path.join(outputFolderPath, 'index.html');
4343

44+
const { ɵInlineCriticalCssProcessor: InlineCriticalCssProcessor } = await loadEsmModule<
45+
typeof import('@nguniversal/common/tools')
46+
>('@nguniversal/common/tools');
47+
4448
const { renderModule, AppServerModule } = await import(serverBundlePath);
4549

4650
const indexBaseName = fs.existsSync(path.join(outputPath, 'index.original.html'))
@@ -66,10 +70,6 @@ export async function render({
6670
});
6771

6872
if (inlineCriticalCss) {
69-
const { ɵInlineCriticalCssProcessor: InlineCriticalCssProcessor } = await loadEsmModule<
70-
typeof import('@nguniversal/common/tools')
71-
>('@nguniversal/common/tools');
72-
7373
const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({
7474
deployUrl: deployUrl,
7575
minify: minifyCss,

0 commit comments

Comments
 (0)