Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/builders/src/ssr-dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
concatMap,
debounce,
debounceTime,
delay,
} from 'rxjs/operators';
import * as browserSync from 'browser-sync';
import { join } from 'path';
Expand Down Expand Up @@ -172,8 +173,10 @@ function startNodeServer(
const path = join(outputPath, 'main.js');
const env = { ...process.env, PORT: '' + port };

return spawnAsObservable('node', [`"${path}"`], { env, shell: true })
return of(null)
.pipe(
delay(0), // Avoid EADDRINUSE error since it will cause the kill event to be finish.
switchMap(() => spawnAsObservable('node', [`"${path}"`], { env, shell: true })),
tap(({ stderr, stdout }) => {
if (stderr) {
logger.error(stderr);
Expand Down