I've setup my-app using the Hono CLI and then changed it following the instructions here. When I run npm exec vite I get this error:
failed to load config from D:\my\temp\hono\my-app\vite.config.ts
error when starting dev server:
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\my\temp\hono\my-app\node_modules\@hono\vite-dev-server\dist\dev-server.js from D:\my\temp\hono\my-app\node_modules\@hono\vite-dev-server\dist\index.cjs not supported.
My vite.config.ts is:
import { defineConfig } from "vite";
import devServer from "@hono/vite-dev-server";
export default defineConfig({
plugins: [
devServer({
entry: "src/index.ts", // The file path of your application.
}),
],
});
I've setup my-app using the Hono CLI and then changed it following the instructions here. When I run
npm exec vite
I get this error:My
vite.config.ts
is:package.json
is:and
src/index.ts
is:I'm using Windows 10, node 20.1.0, and npm 9.6.4.
Any ideas on how I can fix the error? TIA