Skip to content

Commit

Permalink
fix(@nguniversal/builders): address method Promise.prototype.then cal…
Browse files Browse the repository at this point in the history
…led 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)
  • Loading branch information
alan-agius4 committed Oct 27, 2022
1 parent 691e2fe commit 8f47c59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/builders/src/prerender/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export async function render({
const outputFolderPath = path.join(outputPath, route);
const outputIndexPath = path.join(outputFolderPath, 'index.html');

const { ɵInlineCriticalCssProcessor: InlineCriticalCssProcessor } = await loadEsmModule<
typeof import('@nguniversal/common/tools')
>('@nguniversal/common/tools');

const { renderModule, AppServerModule } = await import(serverBundlePath);

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

if (inlineCriticalCss) {
const { ɵInlineCriticalCssProcessor: InlineCriticalCssProcessor } = await loadEsmModule<
typeof import('@nguniversal/common/tools')
>('@nguniversal/common/tools');

const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({
deployUrl: deployUrl,
minify: minifyCss,
Expand Down

0 comments on commit 8f47c59

Please sign in to comment.