lustre-labs / dev-tools

Lustre's CLI and development tooling: zero-config dev server, bundling, and scaffolding.
45 stars 15 forks source link

Can get into a broken state if port is in use #46

Closed ahouseago closed 3 months ago

ahouseago commented 3 months ago

I ran gleam run -m lustre/dev start --port 3001 in the lustre_ui demo project but I already had something running on port 3001 and got an error as expected:

gleam run -m lustre/dev start --port=3001
   Compiled in 0.06s
    Running lustre/dev.main
✅ Project compiled successfully
✅ Esbuild installed!
✅ Bundle produced at `./build/.lustre/index.mjs`
✅ Esbuild already installed!
✅ Started dev server at localhost:3001...

I ran into an error while trying to create a bundle with esbuild:
✘ [ERROR] listen tcp 127.0.0.1:3001: bind: address already in use

1 error

Running it again with a different port gave me a build error though

gleam run -m lustre/dev start --port=3006
   Compiled in 0.04s
    Running lustre/dev.main
❌ Building your project

I couldn't find a public module called `demo` in your project.

To fix this I had to delete the build/ dir and re-run with the free port.

ahouseago commented 3 months ago

Sorry, think this might've been on a previous version of the dev tools: I hadn't updated them before running.

I'll re-open if I see it again!