Skip to content

Commit b8b0277

Browse files
committed
Fix npm run dev toString() error
1 parent be5c643 commit b8b0277

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ import { defineConfig } from "vite";
66
import tsconfigPaths from "vite-tsconfig-paths";
77

88
function consolidateSnippets(projectRoot: string) {
9-
const cmd = spawnSync("tsx", ["utils/consolidateSnippets.ts"], {
9+
const cmd = spawnSync("npx", ["tsx", "utils/consolidateSnippets.ts"], {
1010
cwd: projectRoot,
11+
shell: true,
12+
stdio: "pipe",
1113
});
1214

1315
if (cmd.status === 0) return;
1416

15-
console.log(`Consolidating snippets failed:\n${cmd.output.toString()}`);
17+
const errorMessage = cmd.stderr?.toString().trim() || "No error message";
18+
const outputMessage = cmd.stdout?.toString().trim() || "No additional output";
19+
20+
console.log(`❌ Consolidating snippets failed!`);
21+
console.log(`Error: ${errorMessage}`);
22+
console.log(`Output: ${outputMessage}`);
1623
}
1724

1825
// https://vitejs.dev/config/

0 commit comments

Comments
 (0)