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

Build Keystone inside turborepo fails #9069

Open
DrBoria opened this issue Mar 27, 2024 · 5 comments
Open

Build Keystone inside turborepo fails #9069

DrBoria opened this issue Mar 27, 2024 · 5 comments

Comments

@DrBoria
Copy link

DrBoria commented Mar 27, 2024

`// create turborepo
npx create-turbo@latest my-monorepo
cd my-monorepo

// add keystone to turborepo
cd apps
npm init keystone-app my-keystone-app

cd my-keystone-app
npm run build`

As I expect it should build production-ready static pages. But I'm receiving error NEXT_EXPORT_ERROR
image

If I move keystone outside of turborepo and install dependencies once again - it works fine. But inside - it fails.

Environment:

"@keystone-6/auth": "^7.0.2",
"@keystone-6/core": "^5.7.2",
"@keystone-6/fields-document": "^8.0.2",
Node version 18.18.0

windows 11, macos, and vercel build - same errors.

@stuible
Copy link

stuible commented Mar 28, 2024

I also hit this error when I tried to move from Next 13 to Next 14 inside turborepo.

@MinskLeo
Copy link

Identical situation with upgrade from Next 13 to Next 14 in NX monorepo...

@borisno2
Copy link
Member

borisno2 commented Apr 1, 2024

There is potenitally multiple versions of NextJs in your dependency tree. You could try using overrides to force a particular version of NextJS - I am using Turbo with NextJS 14 without issues but using overrides https://github.com/borisno2/on-the-hill-drama-club/blob/main/package.json#L94

@stuible
Copy link

stuible commented Apr 3, 2024

Good call @borisno2! I thought I had already ruled this out but tried again and was able to build without error.

@DrBoria
Copy link
Author

DrBoria commented Jun 16, 2024

Previously used turborepo - didn't works even with overrides.
As a result - solution is to set in the repository the same version of next as in keystone-6
So for 6.1.0 - "next": "13.3.0"

Works for me.

Same situation with Prisma:
Error: Cannot find module '.prisma/client/default'

Just install prisma: 15.3.0

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

4 participants