keystonejs / keystonejs/keystone

Build Keystone inside turborepo fails

Open
#9,069 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10k
Forks
1.3k
Avg merge
19h 14m
Merged PRs (30d)
19

Description

`// 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](https://github.com/keystonejs/keystone/assets/13663665/e7e03e6c-67ad-4427-be15-a58fd37312e6)

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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the listed create-turbo, npm init keystone-app, and npm run build commands using the reported dependency and Node versions. Compare the generated Keystone app inside and outside the turborepo, then use the NEXT_EXPORT_ERROR output to identify the build difference; done means the turborepo app completes a production build on the reported environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.