Skip to content

Commit a76b47e

Browse files
committed
Fix lazy mode with React Server Components
1 parent 3405c22 commit a76b47e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/reporters/dev-server/src/NodeRunner.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export class NodeRunner {
5151
startWorker(): Promise<void> {
5252
let entry = nullthrows(this.bundleGraph)
5353
.getEntryBundles()
54-
.find(b => b.env.isNode() && b.type === 'js');
54+
.find(
55+
b => b.env.isNode() && /^\.(js|mjs|cjs)/.test(path.extname(b.filePath)),
56+
);
5557
if (entry) {
5658
let relativePath = path.relative(process.cwd(), entry.filePath);
5759
this.logger.log({message: md`Starting __${relativePath}__...`});

packages/reporters/dev-server/src/ServerReporter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22

3+
import path from 'path';
34
import {Reporter} from '@parcel/plugin';
45
import HMRServer from './HMRServer';
56
import Server from './Server';
@@ -69,7 +70,9 @@ export default (new Reporter({
6970
logger,
7071
event.bundleGraph
7172
.getEntryBundles()
72-
.some(b => b.env.isBrowser() || b.type === 'html'),
73+
.some(
74+
b => b.env.isBrowser() || path.extname(b.filePath) === 'html',
75+
),
7376
);
7477
}
7578

0 commit comments

Comments
 (0)