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]: Jump to search results within the website in production environment #1229

Open
talisk opened this issue Jul 3, 2024 · 1 comment
Open
Labels
🐞 bug Something isn't working

Comments

@talisk
Copy link

talisk commented Jul 3, 2024

Version

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 362.38 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 110.0.5481.96
    Edge: 126.0.2592.87
    Safari: 17.4.1
  npmPackages:
    @rspress/core: ^1.25.0 => 1.25.0 
    @rspress/shared: ^1.25.0 => 1.25.0

Details

window.location.href = isProduction()
? suggestion.link
: removeDomain(suggestion.link);

There is a case that I build and deploy a static production code in preview environment. When I click the search item, it jumps to the production env link. It should jump to the preview env link as expected.

CleanShot 2024-07-03 at 11 59 01@2x

Reproduce link

https://codesandbox.io/p/sandbox/rspress-gfnyln

Reproduce Steps

  1. edenx build
  2. Deploy the production to static server as preview environment. OR you can launch a local server by python -m http.server
  3. Access the preview env.
  4. Search and tap result
  5. You will find it jump to domain/path. The domain is configured in your config.ts file.
@talisk talisk added the 🐞 bug Something isn't working label Jul 3, 2024
@Timeless0911
Copy link
Collaborator

You can modify the search.domain config when you build preview.

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

2 participants