H
Hono8mo ago
Blankeos

When there's an error on my typescript code on Hono, Vite Dev Server crashes, and doesn't restart

Problem: - Error? Crash the dev server and not wait for file changes. Ideal experience: - Error? Say it's an error and wait for file changes. It kinda feels iffy that I need to run npm run dev again just to run the dev server. Any fixes for this or maybe just something I missed? My config looks like this:
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";

// Vike
import vike from "vike/plugin";
import vikeSolid from "vike-solid/vite";

// Hono
import devServer from "@hono/vite-dev-server";

// Vite
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const root = resolve(__dirname, ".");

export default defineConfig({
plugins: [
vike(),
vikeSolid(),
devServer({
entry: "./src/server/index.ts",
exclude: [
/^\/@.+$/,
/.*\.(ts|tsx|vue)($|\?)/,
/.*\.(s?css|less)($|\?)/,
/^\/favicon\.ico$/,
/.*\.(svg|png)($|\?)/,
/^\/(public|assets|static)\/.+/,
/^\/node_modules\/.*/,
],
injectClientScript: false,
}),
Icons({
compiler: "solid",
}),
],
server: {
port: 3000,
},
preview: {
port: 3000,
},
resolve: {
alias: {
"@": resolve(root, "src"),
},
},
});
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";

// Vike
import vike from "vike/plugin";
import vikeSolid from "vike-solid/vite";

// Hono
import devServer from "@hono/vite-dev-server";

// Vite
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const root = resolve(__dirname, ".");

export default defineConfig({
plugins: [
vike(),
vikeSolid(),
devServer({
entry: "./src/server/index.ts",
exclude: [
/^\/@.+$/,
/.*\.(ts|tsx|vue)($|\?)/,
/.*\.(s?css|less)($|\?)/,
/^\/favicon\.ico$/,
/.*\.(svg|png)($|\?)/,
/^\/(public|assets|static)\/.+/,
/^\/node_modules\/.*/,
],
injectClientScript: false,
}),
Icons({
compiler: "solid",
}),
],
server: {
port: 3000,
},
preview: {
port: 3000,
},
resolve: {
alias: {
"@": resolve(root, "src"),
},
},
});
1 Reply
Blankeos
BlankeosOP8mo ago
GitHub
GitHub - Blankeos/spend-snap at 029cb1bbe64b17c05290b8399772ab60a94...
💸 Receipt-collation app built with SolidJS Drizzle. - GitHub - Blankeos/spend-snap at 029cb1bbe64b17c05290b8399772ab60a94ec56b
Want results from more Discord servers?
Add your server