-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Port is occupied when starting from container #23
Comments
I don't quite understand what |
Reproduction: https://github.com/yf-yang/rsbuild-storybook-esm/tree/container-bug
Then it would use the ubuntu22.04 image to create a container and install node/pnpm
I've added breakpoints myself and found after Alternatively (if not using devcontainer), npm i
npm run storybook |
Additional information: By adding |
I did reproduce the issue, when running without Docker, there could be two process listening the same port whereas in Docker it throws. I'm not sure does webpack/Vite builder will fail in Docker, either. |
I used webpack builder + container previously, but I am reluctant to reproduce it 🤨. I don't know what dev server does here, but based on the observation it doesn't need to be exposed. (Maybe the claim is wrong, since outside of a container, a port is still needed). |
Coming from WSL and also getting the port in use error. If I edit the start function to
However in the browser log I see:
There doesn't appear to be any server running on 9002, so I guess the error is valid. I get the same startup error if I run the example "react-rsbuild" sandbox app if that helps. |
I tried to migrate the example to our workspace. It is a vscode editor + docker container. Then I found when executing storybook in the container, the port would be occupied before rsbuild dev server is created.
I haven't created something reproducible yet, so it might not be an issue with container environment.
Current observation:
By adding breakpoints, here
storybook-rsbuild/packages/builder-rsbuild/src/preview/virtual-module-mapping.ts
Lines 73 to 77 in d21f101
When
readTemplate
get executed, a browser window pops up. That's where two environment diverges. If I run storybook natively in the laptop, there is no port occupation. If I execute it in the container, after it executes, the port gets occupied, so rsbuild dev server would stop.I'll continue investigating it. Do you have any idea what storybook does here and what is its possible cause?
The text was updated successfully, but these errors were encountered: