-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add file upload in nextjs-keystone example #8179
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c8779bb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 58ab9a6:
|
@flexdinesh There is one unsolved issue. In keystone.ts / generateUrl there is hardcoded port 4000. This will work fine for 'yarn next:dev', but will not work for 'yarn keystone:dev' (port 3000). Normally I would pass this as some env variable, but not sure how to do this in this example without complicating things. Some guidance please. |
@marekryb re: generateUrl there is hardcoded port 4000 That's a tricky one. I think we could use environment variables to identify which server we're running (keystone or next). Perhaps we could replace the current But this probably adds an unwarranted layer of complexity to a simple example. Maybe we should just create a separate example to showcase file uploads with nextjs-keystone example and leave this example be as simple as it could be. |
@flexdinesh I added passing public url through env variable (through cross-env as otherwise someone will come and complain that it doesn't work under Win). Vercel url is prioritized. See how you like the changes. Alternatives are:
PS. This example does not work well at the moment due to #8278 (unrelated) ;-) PS2. Currently there is some random lint error when building through next:build (but not keystone:build). It happens also on main branch (with no changes). Not sure what is happening... |
@borisno2 this fixes the issue with file uploads and graphql-yoga for me. If someone imports keystone in a different project (workspace setup), you need to make sure to export the |
Fixes #8176