Commit abeef37
committed
fix(examples): auto-assign the hub side-car port instead of failing hard
getPort({ random: false }) throws when the preferred side-car port is taken (e.g. by a lingering previous hub instance), so `vite dev` refused to start while the old instance kept serving — which made it look like new code changes (like ctx.terminals spawning) had no effect. Walk a port range and fall back to a random free port instead; clients discover the chosen port via __connection.json either way.1 parent 6d122b5 commit abeef37
2 files changed
Lines changed: 8 additions & 2 deletions
File tree
- examples
- minimal-vite-devframe-hub/src
- storybook-hub/src
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
0 commit comments