ddev-viteserve icon indicating copy to clipboard operation
ddev-viteserve copied to clipboard

Possible to get logs / output?

Open wilr opened this issue 2 years ago • 3 comments

ddev logs -f doesn't output any of the vite output. But I wonder if this is possible?

wilr avatar Jun 28 '23 03:06 wilr

I'm not too surprised, since IIRC vite is running in a separate process, using a program call tmux. To see any output created by the vite process, we could do something like this:

  1. Use tmux to bring forward the vite process. I haven't tried this (or at least, haven't tried it in quite a while), but I believe you can do something like this:
tmux attach-session -t vite-sess
  1. If there was a large need for this, I could make it possible to expose stderr and stdout when I bring up the tmux session that runs vite. This would be a bit nasty, and if you can make due with (1), much better.

torenware avatar Jun 28 '23 03:06 torenware

I have made do with 1 but maybe there could be an additional option like ddev vite-serve listen.

The listen (or another name) argument would be the same as running npm run vite in that errors would come to stdout, I would prefer to have an open vite process rather than one running in a tmux session that I don't have output for without running 1.

JshGrn avatar Nov 29 '23 13:11 JshGrn

To add to this, where for some reason Vite restarts and has a error where it starts on the port +1, I have no idea on this until I use the above to realise why.

Perhaps option 2 should be looked at and at the very least the text about port being taken should be parsed and output as an error to flag?

JshGrn avatar Dec 05 '23 11:12 JshGrn