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

Bug in default example for NextJS App Router #9298

Open
MaxHarrington opened this issue Aug 19, 2024 · 1 comment
Open

Bug in default example for NextJS App Router #9298

MaxHarrington opened this issue Aug 19, 2024 · 1 comment

Comments

@MaxHarrington
Copy link

MaxHarrington commented Aug 19, 2024

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.

image

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.

@MaxHarrington
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant