I followed the quick start guide. I wanted to create the "Starter (Users + Authentication)" type of app with the PostgreSQL database. Below is an output from my terminal of what I did (PLEASE NOTE: I had already created the database on a previous try that ended in the exact same error).
๏
น ๏ผ ~/Projects โฏ yarn create keystone-app school-dispatch ๏ 4s
yarn create v1.22.4
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐จ Building fresh packages...
success Installed "[email protected]" with binaries:
- create-keystone-app
[############################################################] 60/60
โฆโโ โโโ โฆ โฆ โโโ โโฆโ โโโ โโโ โโโ โฆ โโโ
โ โฉโ โโฃ โโฆโ โโโ โ โ โ โโโ โโฃ โ โโโ
โฉ โฉ โโโ โฉ โโโ โฉ โโโ โโโ โโโ โโ โโโ
Answer a few questions and we'll generate a starter project for you.
โ What is your project name? โฆ School Dispatch
โ Select a starter project โบ Starter (Users + Authentication)
โ Select an adapter โบ Knex
โ Copying project files
Installing dependencies with yarn. This could take a few minutes.
โ Installed dependencies
๐ KeystoneJS created a starter project in: school-dispatch
To launch your app, run:
- cd school-dispatch
- yarn dev
Next steps:
- View your app
- Edit school-dispatch/index.js to customize your app.
- Open the Admin UI
- Read the docs
- Star KeystoneJS on GitHub
โจ Done in 48.18s.
๏
น ๏ผ ~/Projects โฏ cd school-dispatch ๏ 48s
๏
น ๏ผ ~/Projects/school-dispatch โฏ 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
โ Initialised Keystone instance
โ Connecting to database
{ Error: Cannot read property 'find' of undefined
at Promise.all.then.results (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/utils/dist/utils.cjs.dev.js:48:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
errors:
{ KnexAdapter:
TypeError: Cannot read property 'find' of undefined
at fieldAdapters.forEach.fieldAdapter (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/adapter-knex/lib/adapter-knex.js:258:31)
at Array.forEach (<anonymous>)
at KnexListAdapter._postConnect (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/adapter-knex/lib/adapter-knex.js:257:24)
at Object.values.forEach.listAdapter (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/adapter-knex/lib/adapter-knex.js:73:19)
at Array.forEach (<anonymous>)
at KnexAdapter.postConnect (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/adapter-knex/lib/adapter-knex.js:72:38)
at KnexAdapter.connect (/Users/caleb/Projects/school-dispatch/node_modules/@keystonejs/adapter-knex/node_modules/@keystonejs/keystone/lib/adapters/index.js:29:38)
at process._tickCallback (internal/process/next_tick.js:68:7) } }
error Command failed with exit code 1.
I expected to be able to start up my demo project.
I also already have tried the {dropDatabase: true hack that I saw in other solutions, but that didn't work here.
Hey @wcalebgray
Had the same issue. It looks like a problem with version mismatch between @keystonejs/keystone and @keystonejs/adapter-knex
I noticed that I had those in package.json:
"@keystonejs/adapter-knex": "^7.0.0",
"@keystonejs/keystone": "^6.0.1",
after upgrade to:
"@keystonejs/adapter-knex": "^7.0.0",
"@keystonejs/keystone": "^7.0.0",
keystone started working
Can confirm the update to keystone fixed. Thanks @wini16
Just ran into this when looking into the project as a possible option, glad someone shared this with me.
Confirmed as well, thanks @wini16 ! Leaving this open until either myself or someone can fix the starter app stuff.
This has been fixed in version 3.0.0 of create-keystone-app. Please try running the script at this new version and by all means re-open this ticket if you find the same/similar issues with the latest version.
Most helpful comment
Hey @wcalebgray
Had the same issue. It looks like a problem with version mismatch between
@keystonejs/keystoneand@keystonejs/adapter-knexI noticed that I had those in package.json:
"@keystonejs/adapter-knex": "^7.0.0","@keystonejs/keystone": "^6.0.1",after upgrade to:
"@keystonejs/adapter-knex": "^7.0.0","@keystonejs/keystone": "^7.0.0",keystone started working