Getting started for Keystone 5 ends up in errors, not in fun coding experience!!!
Steps to reproduce the behaviour. Please provide code snippets or a repository:
{
"name": "@keystonejs/example-projects-todo",
"description": "An example KeystoneJS project showcasing a simple Todo List with a Keystone StaticApp front-end.",
"private": true,
"version": "5.0.12",
"author": "The KeystoneJS Development Team",
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/create-keystone-app/example-projects/todo",
"homepage": "https://github.com/keystonejs/keystone",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"scripts": {
"dev": "cross-env NODE_ENV=development DISABLE_LOGGING=true keystone dev",
"build": "cross-env NODE_ENV=production keystone build",
"start": "cross-env NODE_ENV=production keystone start",
"create-tables": "cross-env keystone create-tables"
},
"dependencies": {
"@keystonejs/adapter-knex": "^11.0.1",
"@keystonejs/app-admin-ui": "^7.1.0",
"@keystonejs/app-graphql": "^6.0.0",
"@keystonejs/app-static": "^5.1.2",
"@keystonejs/fields": "^14.0.0",
"@keystonejs/keystone": "^12.0.0",
"cross-env": "^7.0.0"
}
}
Log output:
$ yarn dev
yarn run v1.22.4
$ cross-env NODE_ENV=development DISABLE_LOGGING=true keystone dev
ℹ Command: keystone dev
✔ Validated project entry file ./index.js
✔ Keystone server listening on port 3000
No cookieSecret value was provided. Please generate a secure value and add it to your app. Until this is done, a random cookieSecret will be generated each time Keystone is started. This will cause sessions to be reset between restarts. See [https://www.keystonejs.com/keystonejs/keystone/#cookiesecret] for details.
✔ Initialised Keystone instance
✖ Initialising Keystone instance
TypeError: keystone.createApolloServer is not a function
at GraphQLApp.prepareMiddleware (/Users/ignatev/Projects/mobile-cms-js/mobile-cms/node_modules/@keystonejs/app-graphql/index.js:28:29)
at /Users/ignatev/Projects/mobile-cms-js/mobile-cms/node_modules/@keystonejs/keystone/lib/Keystone/index.js:609:17
at Array.map (<anonymous>)
at Keystone._prepareMiddlewares (/Users/ignatev/Projects/mobile-cms-js/mobile-cms/node_modules/@keystonejs/keystone/lib/Keystone/index.js:608:12)
at Keystone.prepare (/Users/ignatev/Projects/mobile-cms-js/mobile-cms/node_modules/@keystonejs/keystone/lib/Keystone/index.js:626:36)
at executeDefaultServer (/Users/ignatev/Projects/mobile-cms-js/mobile-cms/node_modules/@keystonejs/keystone/bin/utils.js:149:42)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Thank you for any help resolving this issue!
If your setup works, please share package.json and any additional info! Many thanks!
Hi @vladignatyev it's likely the CLI is caching one of dependencies. A method in @keystonejs/app-graphql was moved to @keystonejs/keystone both packages had major version bumps, but if somehow @keystonejs/app-graphql is updated without updating the core package as well - you will see this error.
We think this is happening with create-keystone-app at the moment. We're working on a fix to the CLI so this can't happen again but in the mean time please try updating all keystone dependencies with Yarn or NPM.
npm install --save @keystonejs/keystone^13.0.0 solves the issue
What did actually solve my problem is copying dependencies from one of the
example projects in the repository. Something like this:
"@keystonejs/adapter-knex": "^11.0.1",
"@keystonejs/app-admin-ui": "^7.2.0",
"@keystonejs/app-graphql": "^6.1.0",
"@keystonejs/app-static": "^5.1.2",
"@keystonejs/field-content": "7.0.0",
"@keystonejs/fields": "^15.0.0",
"@keystonejs/file-adapters": "^7.0.2",
"@keystonejs/keystone": "^13.0.0",
"cross-env": "^7.0.0"
чт, 6 авг. 2020 г. в 16:05, amirmamaghani notifications@github.com:
yarn install @keystonejs/keystone^13.0.0 solves the issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/keystonejs/keystone/issues/3349#issuecomment-669887059,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAD5PFEU6SA5KLP2RTFP4OLR7KMBDANCNFSM4PVYD2LA
.
update package.json with this:
{
"name": "@keystonejs/example-projects-starter",
"description": "An example KeystoneJS project with a User list and Authentication.",
"private": true,
"version": "5.0.12",
"author": "The KeystoneJS Development Team",
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/create-keystone-app/example-projects/starter",
"homepage": "https://github.com/keystonejs/keystone",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"scripts": {
"dev": "cross-env NODE_ENV=development DISABLE_LOGGING=true keystone dev",
"build": "cross-env NODE_ENV=production keystone build",
"start": "cross-env NODE_ENV=production keystone start",
"create-tables": "cross-env CREATE_TABLES=true keystone create-tables"
},
"dependencies": {
"@keystonejs/adapter-mongoose": "^9.0.0",
"@keystonejs/app-admin-ui": "^7.1.0",
"@keystonejs/app-graphql": "^6.0.0",
"@keystonejs/auth-password": "^5.1.11",
"@keystonejs/fields": "^14.0.0",
"@keystonejs/keystone": "^13.0.0",
"cross-env": "^7.0.0"
}
}
and should work
Hello, this fixed this issue for me. Hope this will help you. Go and update package.json and change the keystone version from 12.0.0 to 13.0.0 as this image

It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)
Would be great if someone paid attention to this issue, because it blocks
newbies like me from starting his journey with KeystoneJS.
сб, 5 дек. 2020 г. в 15:35, stale[bot] notifications@github.com:
It looks like there hasn't been any activity here in over 6 months. Sorry
about that! We've flagged this issue for special attention. It wil be
manually reviewed by maintainers, not automatically closed. If you have any
additional information please leave us a comment. It really helps! Thank
you for you contribution. :)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/keystonejs/keystone/issues/3349#issuecomment-739239317,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAD5PFB33CSNFSNIH32A7R3STILIPANCNFSM4PVYD2LA
.
Most helpful comment
npm install --save @keystonejs/keystone^13.0.0solves the issue