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

Cannot customize root level admin route #8886

Closed
thgh opened this issue Oct 28, 2024 · 3 comments
Closed

Cannot customize root level admin route #8886

thgh opened this issue Oct 28, 2024 · 3 comments

Comments

@thgh
Copy link
Contributor

thgh commented Oct 28, 2024

Describe the Bug

Following https://payloadcms.com/docs/beta/admin/overview#customizing-root-level-routes does not allow updating routes.admin

  1. It's not allowed by Typescript
  2. It cannot find a place to put import map as the admin folder was moved

Link to the code that reproduces this issue

if (fs.existsSync(path.resolve(rootDir, 'app/(payload)/admin/'))) {
importMapFolderPath = path.resolve(rootDir, 'app/(payload)/admin/')
} else if (fs.existsSync(path.resolve(rootDir, 'src/app/(payload)/admin/'))) {
importMapFolderPath = path.resolve(rootDir, 'src/app/(payload)/admin/')

Reproduction Steps

  1. Move any files from src/app/(payload)/admin one folder up
  2. Set routes.admin = '/' in payload config
  3. Start dev server

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

area: core

Environment Info

Binaries:
Node: 22.5.1
npm: 10.8.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
payload: 3.0.0-beta.117
next: 15.0.1
@payloadcms/db-mongodb: 3.0.0-beta.117
@payloadcms/email-nodemailer: 3.0.0-beta.117
@payloadcms/graphql: 3.0.0-beta.117
@payloadcms/next/utilities: 3.0.0-beta.117
@payloadcms/plugin-cloud: 3.0.0-beta.117
@payloadcms/richtext-lexical: 3.0.0-beta.117
@payloadcms/translations: 3.0.0-beta.117
@payloadcms/ui/shared: 3.0.0-beta.117
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020

@thgh thgh added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 28, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 28, 2024
@jeffreylouden
Copy link

Is this a duplicate of #7803?

@paulpopus
Copy link
Contributor

  1. Setting routes.admin on the top level (note: not inside admin) worked for me just fine on the latest beta TS wise
  2. Yeah I can confirm this is an issue and duplicate of ^

Will look into the attached PR, closing this and we'll track progress in that issue

Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants