Skip to content

Commit 5ad4cc9

Browse files
committed
webpack: Fix undefined outputPath error in afterEmit hook
- Add check for compilation.outputPath before using it - This prevents the TypeError when outputPath is undefined - Should fix the build failure in GitHub Actions
1 parent 9ac4912 commit 5ad4cc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/web/webpack.config.d/sqljs-config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ class SQLJsWasmFixPlugin {
7070
const fs = require('fs');
7171
const path = require('path');
7272

73+
// Check if outputPath is defined
74+
if (!compilation.outputPath) {
75+
console.log('🔧 No outputPath defined, skipping distribution file processing');
76+
callback();
77+
return;
78+
}
79+
7380
// Process distribution files if they exist
7481
const distPath = path.join(compilation.outputPath, '..', 'dist', 'wasmJs', 'productionExecutable');
7582
if (fs.existsSync(distPath)) {
@@ -99,6 +106,8 @@ class SQLJsWasmFixPlugin {
99106
}
100107
}
101108
});
109+
} else {
110+
console.log('🔧 Distribution path does not exist:', distPath);
102111
}
103112
callback();
104113
});

0 commit comments

Comments
 (0)