Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@hono/vite-dev-server] Best way to develop locally? #42

Closed
kevbook opened this issue Dec 21, 2023 · 4 comments · Fixed by #43
Closed

[@hono/vite-dev-server] Best way to develop locally? #42

kevbook opened this issue Dec 21, 2023 · 4 comments · Fixed by #43

Comments

@kevbook
Copy link

kevbook commented Dec 21, 2023

I'm using a basic vite-dev-server setup (see below). abc gets caught within the vite process and vite displays the error and watches the file system and restarts the server. But outside doesn't get caught the same way, and the vite process crashes. What is the recommended way to run a local dev server (via nodemon?)

export default defineConfig({
  plugins: [
    devServer({
      entry: 'src/index.ts', // The file path of your application.
    }),
  ],
});
import { Hono } from 'hono';
const app = new Hono();
outside;
app.get('/', (c) => {
  abc;  
  return c.text('Hello Vitess!');
});
export default app;
@yusukebe
Copy link
Member

Hi @kevbook

Maybe we should make it does not crash and restart automatically also in that case. I'll take a look later.

What is the recommended way to run a local dev server (via nodemon?)

This local dev server can run only Vite. So, for instance, you can use tsx watch src/index.ts command if you run it on Node.js.

@kevbook
Copy link
Author

kevbook commented Dec 21, 2023

Yea, it would be awesome if you could make it not crash. I use Sveltekit (uses Vite) which has a similar dev experience.

@yusukebe
Copy link
Member

So, for instance, you can use tsx watch src/index.ts command if you run it on Node.js.

Ah, it also crashes with using tsx.

I use Sveltekit (uses Vite) which has a similar dev experience.

Okay, I can refer to it. Thanks!

@yusukebe
Copy link
Member

@kevbook

I've released v0.3.2 which does not crash in that case. Please try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants