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

Can't reindex search when using next's basePath option #10631

Open
suphon-t opened this issue Jan 17, 2025 · 0 comments · May be fixed by #10632
Open

Can't reindex search when using next's basePath option #10631

suphon-t opened this issue Jan 17, 2025 · 0 comments · May be fixed by #10632
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@suphon-t
Copy link
Contributor

Describe the Bug

The reindex button from the search plugin calls incorrect URL when using Next's basePath option.

In this picture, I've set the basePath to /payload, so API routes are under /payload/api, but the reindex button calls /api without the prefix, causing it to return 404.
Image

Link to the code that reproduces this issue

https://github.com/suphon-t/payload/tree/reproduce/search-reindex-next-basepath

Reproduction Steps

  1. Create a new project using npx create-payload-app
  2. Edit next.config.mjs and set basePath to something (in this case, I set it to /payload)
  3. Open the admin panel and go to the "Search Results" collection
  4. Reindex any collection
  5. The button calls an incorrect URL and gets a 404

Which area(s) are affected? (Select all that apply)

plugin: search

Environment Info

Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.15.1
Relevant Packages:
  payload: 3.15.1
  next: 15.1.0
  @payloadcms/email-nodemailer: 3.15.1
  @payloadcms/graphql: 3.15.1
  @payloadcms/next/utilities: 3.15.1
  @payloadcms/payload-cloud: 3.15.1
  @payloadcms/plugin-search: 3.15.1
  @payloadcms/richtext-lexical: 3.15.1
  @payloadcms/translations: 3.15.1
  @payloadcms/ui/shared: 3.15.1
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020
  Available memory (MB): 65536
  Available CPU cores: 12

Note that I'm using v3.15.1 because v3.16.0 - v3.17.1 currently suffers from #10534.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Contributor status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant