The build functions for the NextJS app router example are not functioning as expected when cloned from GitHub. When you attempt to build the Keystone interface, it will not compile the GraphQL files, as the script expects the 'pages' file to be located within an 'admin' directory at the root of the project, instead of located within the ~/src/pages/api/[arbitrary routes or pages for the Keystone admin view here].
The build will pick up the GraphQL endpoint as it should when the files are moved to the base directory, but wrapped inside of the admin directory.
I've also placed the NextAuth module there, to demonstrate how I figured out this process, and for how future users can embed NextAuth into Keystone using the App Router.
Build error will occur on all versions, it's a problem with file structure.
This should be a pretty trivial fix to improve the developer experience on NextJS quite a bit, I hope I've provided enough information to improve this for others. It is a rather simple movement of files.
https://github.com/keystonejs/keystone/tree/main/examples/framework-nextjs-app-directory
The build functions for the NextJS app router example are not functioning as expected when cloned from GitHub. When you attempt to build the Keystone interface, it will not compile the GraphQL files, as the script expects the 'pages' file to be located within an 'admin' directory at the root of the project, instead of located within the ~/src/pages/api/[arbitrary routes or pages for the Keystone admin view here].
The build will pick up the GraphQL endpoint as it should when the files are moved to the base directory, but wrapped inside of the admin directory.
I've also placed the NextAuth module there, to demonstrate how I figured out this process, and for how future users can embed NextAuth into Keystone using the App Router.
Build error will occur on all versions, it's a problem with file structure.