payloadcms / payloadcms/payload
HMR/Dev Server updates broken when using nextjs basePath
@AlessioGr is already working on this.
Since Apr 20, 2026.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
When running Payload on a basePath such as /cms and trying to make config changes like adding new collections or adding / updating fields, these changes are never reflected by the dev server even with a hard refresh.
Link to the code that reproduces this issue
https://github.com/sutho91/subpath-hmr
Reproduction Steps
The reproduction server is already setup to run on the basePath of /cms and setup for use with sql-lite.
- Start the dev server
- Go to http://localhost:3000/cms/admin
- Add a new collection or update a field on an existing collection (There is a Tags collection which is currently commented that you can just uncomment)
- Check to see if the change you made is reflected
If you now disable the basePath and retry the same steps, the dev server will work again as per normal.
PS. This used to work fine a while ago. Im unsure of which version of Payload this stopped working in.
Which area(s) are affected?
area: core
Environment Info
Binaries:
Node: 24.13.0
npm: 11.6.2
Yarn: 1.22.22
pnpm: 10.28.2
Relevant Packages:
payload: 3.83.0
next: 16.2.3
@payloadcms/db-sqlite: 3.83.0
@payloadcms/drizzle: 3.83.0
@payloadcms/graphql: 3.83.0
@payloadcms/next/utilities: 3.83.0
@payloadcms/richtext-lexical: 3.83.0
@payloadcms/translations: 3.83.0
@payloadcms/ui/shared: 3.83.0
react: 19.2.4
react-dom: 19.2.4
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
Available memory (MB): 15827
Available CPU cores: 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.