Skip to content

Commit d99e397

Browse files
committed
demo(fix): Workaround for incomplete node 22 network interfaces
1 parent 9b57a55 commit d99e397

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

examples/coin-app/webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ module.exports = (env, argv) => {
1414
const config = generateConfig(env, argv);
1515
if (!config.experiments) config.experiments = {};
1616
config.experiments.backCompat = false;
17+
if (config.devServer) {
18+
// Avoid network interface enumeration that crashes in StackBlitz WebContainers
19+
config.devServer.host = 'localhost';
20+
config.devServer.allowedHosts = [
21+
'.stackblitz.io',
22+
'localhost',
23+
'127.0.0.1',
24+
];
25+
}
1726

1827
return config;
1928
};

examples/github-app/webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ const generateConfig = makeConfig(options);
1818

1919
module.exports = (env, argv) => {
2020
const config = generateConfig(env, argv);
21+
if (config.devServer) {
22+
// Avoid network interface enumeration that crashes in StackBlitz WebContainers
23+
config.devServer.host = '127.0.0.1';
24+
config.devServer.allowedHosts = [
25+
'.stackblitz.io',
26+
'localhost',
27+
'127.0.0.1',
28+
];
29+
}
2130
return config;
2231
};
2332

examples/todo-app/webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ module.exports = (env, argv) => {
1818
const config = generateConfig(env, argv);
1919
config.entry = config.entry.App;
2020
if (config.devServer) {
21-
config.devServer.allowedHosts = ['.csb.app', 'localhost', '127.0.0.1'];
21+
// Avoid network interface enumeration that crashes in StackBlitz WebContainers
22+
config.devServer.host = 'localhost';
23+
config.devServer.allowedHosts = [
24+
'.csb.app',
25+
'.stackblitz.io',
26+
'localhost',
27+
'127.0.0.1',
28+
];
2229
}
2330
return config;
2431
};

0 commit comments

Comments
 (0)