Skip to content

Move segments to root instead of /admin #7249

@mikexavier

Description

@mikexavier

Link to reproduction

No response

Payload Version

3.0.0-beta.67

Node Version

20.12.2

Next.js Version

15.0.0-canary.58

Describe the Bug

Trying to move from using the admin directory to running the cms from the root /

When I moved just the segments folder to (payload), and added routes.admin '/' to buildConfig

This makes all collection links http://collections/users

If I update routes.admin to http://localhost:3000 then links work to each collection.

http://localhost:3000 loads and displays collections, along with some errors:

Warning: You are mounting a new html component when a previous one has not first unmounted. It is an error to render more than one html component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <html> and if you need to mount a new one, ensure any previous ones have unmounted first.

Warning: You are mounting a new body component when a previous one has not first unmounted. It is an error to render more than one body component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <body> and if you need to mount a new one, ensure any previous ones have unmounted first.

Error: Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client.

Trying to access account at http://localhost:3000/account throws

TypeError: Missing parameter name at 4
GET http://localhost:3000/account 500 (Internal Server Error)

Moving segments back under /admin and removing routes.admin and everything is right in the world again 😌

Reproduction Steps

Moved just the segments folder to (payload), and added routes.admin '/' to buildConfig

Adapters and Plugins

db-postgres, storage-s3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions