Comments (6)
When initialising the next-payload
package, you will noticed that in your app
directory will be created a group folder called (payload)
inside which is a folder called admin
which is the route set by payload by default.
Inside your next.config.ts
file you are then asked to wrap your config in the withPayload
helper. This wrapper sets a few next.config parameters for you, one of which is the handling of all routes on the admin
path.
The reason you get 404 is likely that you attempt to use dashboard
as your admin route, but the configuration isn't set up to match this path.
from next-payload.
I am going to close this issue @okeken. I believe @imCorfitz is correct, unless you manually changed the folder name inside app/(payload)/admin
to app/(payload)/dashboard
and adjusted your payload config's admin path to match this.
Also note that the reset password url is /reset-password
not /reset
from next-payload.
@JarrodMFlesch correct, I changed the (payload)/admin to match the admin route in my payload.config.ts file, is there a way to use a custom name other than admin, I'm using it for a web app, where the dashboard is also being being used by the end users.
from next-payload.
I might be confused, what's not working for you? You set the admin route on routes.admin
to '/dashboard' on your payload config? https://payloadcms.com/docs/configuration/overview#options
from next-payload.
You might also need to set the rewrite in next.config.js
. I have created a PR that enables you to set the custom path as part of the withPayload
config, and some documentation along with it. #47
But basically, the withPayload
wrapper in next.config.js
creates a rewrite
config which forwards all routes on /admin/*
to the page.tsx
in /app/(payload)/admin
. In order to change this, you would need to add a custom rewrite object to your next.config.js
which says something like
{
rewrites: [
{
source: "/dashboard/:path*",
destination: "/dashboard",
}
]
}
from next-payload.
oh @imCorfitz nice! I will check that out and a couple other outstanding PR's here as well today.
from next-payload.
Related Issues (20)
- Broken with Next.js 14 HOT 10
- Local File Upload Path Mismatch? HOT 4
- Warning: ToastContainer HOT 2
- getPayload is not a function / req.payload is a Promise? HOT 3
- Payload CMS overrides styled-component GlobalStyles HOT 1
- Warning Custom CSS file not found at undefined. Next.config.js HOT 2
- Broken styles with Payload 2.0 and Next 14 HOT 1
- TypeError: this.config.db is not a function HOT 3
- API Key: You are not allowed to perform this action. HOT 1
- `Error [ERR_REQUIRE_ESM]: require() of ES Module` error when using component in /pages instead of /app folder HOT 4
- Custom views don't work HOT 2
- `getPayloadClient()` fails in server actions HOT 2
- Builds dont work with next14 HOT 6
- Status 500 error with vercel deploy (next14) HOT 2
- Unexpected handler pages/api/[collection]/lib/worker.js HOT 1
- Can't login '/admin' after creating initial admin account on '/admin' page (Next.JS 14 with next-payload) HOT 4
- Incompatability with lexical editor HOT 1
- Unexpected handler pages/api/[collection]/lib/worker.js in next-payload HOT 5
- `loadConfig is not a function` when running `next-payload build` HOT 2
- Full restart required for changes to apply correctly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-payload.