@kya-os/mcp-i 1.6.1 → 1.6.2-canary.clientinfo.20251126041014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,6 +121,11 @@ async function compileInternal({ onBuild } = {}) {
121
121
  (0, fs_utils_1.createFolder)(constants_1.runtimeFolderPath);
122
122
  generateCode();
123
123
  const compiler = (0, webpack_1.webpack)(webpackConfig);
124
+ // Webpack returns null if config is invalid
125
+ if (!compiler) {
126
+ reject(new Error("Failed to create webpack compiler - invalid config"));
127
+ return;
128
+ }
124
129
  const handleCompilation = (err, stats) => {
125
130
  if (err) {
126
131
  console.error(err);
@@ -179,9 +184,14 @@ async function compileInternal({ onBuild } = {}) {
179
184
  const watching = compiler.watch({}, handleCompilation);
180
185
  // Store watching instance for proper cleanup
181
186
  process.on('SIGINT', () => {
182
- watching.close(() => {
187
+ if (watching) {
188
+ watching.close(() => {
189
+ process.exit(0);
190
+ });
191
+ }
192
+ else {
183
193
  process.exit(0);
184
- });
194
+ }
185
195
  });
186
196
  }
187
197
  });
@@ -116,6 +116,11 @@ async function compileConfig() {
116
116
  };
117
117
  return new Promise((resolve, reject) => {
118
118
  const compiler = (0, webpack_1.webpack)(webpackConfig);
119
+ // Webpack returns null if config is invalid
120
+ if (!compiler) {
121
+ reject(new Error("Failed to create webpack compiler - invalid config"));
122
+ return;
123
+ }
119
124
  // Use memory filesystem for output
120
125
  compiler.outputFileSystem = memoryFs;
121
126
  compiler.run((err, stats) => {