-
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
fix: make rsbuild listen on a random port #47
Conversation
Great work! I am wondering should Rsbuild listen to a port in middleware mode? If so, what's the purpose? 🤔 Could @chenjiahan give some guidance. |
Rsbuild server should not listen to any port in the middleware mode, @9aoy can you check this |
htmlFallback: false, | ||
strictPort: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I'll remove port setting.
Hey @fi3ework, this fixed the "occupied port" issue when running Storybook from a container/remote environment. However, the HMR stopped working cause now Storybook doesn't know the dev server port. |
rsbuild will listen to another port due to a port conflict, but hmr still works because the rsbuild dev middleware can accept connections through the Storybook server
for a speedy verification, you can follow the instructions to confirm if it functions in a container environment: FROM ubuntu:latest
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
ENV NVM_DIR=/root/.nvm
ADD https://github.com/rspack-contrib/storybook-rsbuild.git /app
WORKDIR /app
RUN apt-get update && apt-get install -y curl && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
. ~/.bashrc && nvm install && \
corepack enable && pnpm i && pnpm build
EXPOSE 6006
CMD [ "bash", "-c", ". /root/.nvm/nvm.sh && pnpm -C sandboxes/react-18 exec storybook dev --no-open -p 6006" ] |
close #23
close #32