-
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
Cannot set Keystone up inside a monorepo #8153
Comments
I don't think Keystone is the root of this issue (although it is happening because keystone comes with its own Next.js version). We have used Keystone in monorepo setups with Next.js apps. Our e2e-boilerplate example uses Keystone with yarn workspaces. If your |
Hmmm. This is what I thought - the sites are not importing anything - it's all GraphQL work. I've tried installing manypkg - it seemed to resolve dependency issues but it doesn't seem to be working - keystone still gives me the same error trying to access the admin UI. I have fixed this - I've disabled hoisting over the entire monorepo - this seems to be a Yarn v1 issue: yarnpkg/yarn#7572 @flexdinesh thanks for your help with this! For future people running into this problem - here is what I changed. It seems to be a Yarnv1 issue, and I will start looking at migrating to Yarnv2. But for those on V1, I have a structure similar to this:
My {
"name": "sites",
"version": "0.0.0",
"private": true,
"workspaces": {
"packages": [
"apps/*",
"packages/*"
],
"nohoist": [
"**" // THIS DISABLES HOISTING OVER THE WHOLE REPO. See the above Yarn issue (due to an issue w/ Yarn v1)
]
},
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@manypkg/cli": "^0.19.2",
"eslint-config-custom": "*",
"prettier": "latest",
"turbo": "latest"
},
"packageManager": "yarn@1.22.19"
} |
Okay - I run a number of sites under one Keystone instance. The idea is I wanted something like the below:
I'm using turborepo for this (mainly because I assumed it being a vercel-owned property that would make this easier) which uses Yarn Workspaces under the hood.
I'm aware other (solved) issues exist - including some outside this repo. I'll link the ones I have tried for reference:
My issue seems to be that Keystone is seeing two versions of NextJS - the version I have given it (12.3.1 as it currently is inside my separated repository) according to this
So when I try and launch the admin UI, I get this:
What I have tried
next: 12.3.1
inapps/keystone/package.json
next
entirelyNo changes.
My environment:
Node v16.18.0
Yarn 1.22.19
Next 13.0.1
I have a demo here
The text was updated successfully, but these errors were encountered: