Dev server port detection now works reliably in all environments
Fixed dev server port resolution to prevent localhost connection failures when Vite assigns random ports.
2 min read
0.46.2
3D scene: "Nature" by 3Donimus CC-BY via Poly PizzaFixed
Dev server port resolution now waits for bind. Previously, @editframe/elements read the configured port from Vite's config before the server started listening. When the configured port was unavailable, Vite would bind to a random port instead — but our code still tried to connect to the original port, causing localhost connection failures. We now call server.listen() first and read the actual bound port from httpServer.address(). This eliminates race conditions and ensures the dev server apiHost always resolves correctly.
Test isolation for __EF_DEFAULT_API_HOST__. Fixed browser tests that were inadvertently reading cached values from window.__EDITFRAME__, causing false positives when testing the Vite plugin's index.html transform behavior. Each test now runs in a clean context.