Skip to content
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

[Bug]: preview command does not work with base option enabled #1538

Open
JounQin opened this issue Oct 30, 2024 · 4 comments
Open

[Bug]: preview command does not work with base option enabled #1538

JounQin opened this issue Oct 30, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@JounQin
Copy link
Contributor

JounQin commented Oct 30, 2024

Version

System:
OS: macOS 15.0.1
CPU: (10) arm64 Apple M1 Max
Memory: 3.78 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 130.0.6723.91
Safari: 18.0.1
npmPackages:
@rspress/core: ^1.35.1 => 1.35.1

Details

https://v6zdkq-4173.csb.app/docs

Image

Image

Reproduce link

https://codesandbox.io/p/devbox/quiet-feather-v6zdkq

Reproduce Steps

  1. run npm i && npm run build && npm run preview
  2. open http://localhost:4173/docs
@JounQin JounQin added the 🐞 bug Something isn't working label Oct 30, 2024
@SoonIter
Copy link
Member

Image

cannot reproduce it

Image

@JounQin
Copy link
Contributor Author

JounQin commented Oct 30, 2024

OK, I found the issue is that base: 'docs' works fine on development, but it requires to be /docs on previewing. Seems a bit inconsistent. :(

@JounQin
Copy link
Contributor Author

JounQin commented Oct 30, 2024

And if server: {open: true} is provided, it will open browser without base which results a 404 page immediately.

Image

@Timeless0911
Copy link
Collaborator

Timeless0911 commented Oct 30, 2024

And if server: {open: true} is provided, it will open browser without base which results a 404 page immediately.

Image

server: {
  open: '/docs',
},

see https://rsbuild.dev/config/server/open#serveropen for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants