Closed tmkx closed 5 days ago
Storybook and rsbuild should listen to the SAME hostname and port, this relies on the middlewareMode supporting of rsbuild, not listening by itself.
@storybook/builder-webpack5: https://github.com/storybookjs/storybook/blob/3a1e61cefec8dfd350d42db5598b2d0d9159a878/code/builders/builder-webpack5/src/index.ts#L186
@storybook/builder-vite: https://github.com/storybookjs/storybook/blob/3a1e61cefec8dfd350d42db5598b2d0d9159a878/code/builders/builder-vite/src/index.ts#L66
Background
I'm trying to add storybook tests to the CI workflow, but the rsbuild crashes due to a port duplicate:
Reproduction steps
Here is a Dockerfile that describes how to build a problematic image:
Root causes
The following code snippet works on macOS but will throw an error on Linux:
https://github.com/storybookjs/storybook/blob/8505d86feeecd13a8473fa1372cf37500519d136/code/core/src/core-server/dev-server.ts#L66-L69
Workaround
storybook dev -p 6006 -h 0.0.0.0
can make storybook core listens to0.0.0.0
while rsbuild still listens onlocalhost
network, so that they don't running on the same hostname