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

Keystone started crashing with: TypeError: Cannot read property 'create' of undefined #3369

Closed
terrygonguet opened this issue Aug 10, 2020 · 0 comments

Comments

@terrygonguet
Copy link

terrygonguet commented Aug 10, 2020

Bug report

Describe the bug

When calling keystone.prepare(), the server crashes while initiating Apollo.

To Reproduce

Admitedly my setup is a bit complex because I use Sapper as the frontend so I'm not sure if the bug happens in other cases but as far as I can see it doesn't have to do anything with anything other than Keystone.

System information

  • OS: Win10
  • Node 14.2
  • NPM 6.14.4

Additional context

tldr of the stack:
In prepare(), Keystone calls this.createApolloServer({ schemaName: 'internal' }). The Lists objects' access properties only know of a "public" schema and so Apollo cannot get field.access.internal.create.
If I replace "internal" by "public" in prepare it runs fine.

Here are my Keystone versions:

	"@keystonejs/adapter-knex": "^11.0.1",
	"@keystonejs/adapter-mongoose": "^9.0.1",
	"@keystonejs/app-admin-ui": "^7.3.0",
	"@keystonejs/app-graphql": "^6.0.0",
	"@keystonejs/app-static": "^5.1.2",
	"@keystonejs/auth-password": "^5.1.13",
	"@keystonejs/field-content": "^7.0.3",
	"@keystonejs/fields": "^14.0.0",
	"@keystonejs/fields-authed-relationship": "^1.0.10",
	"@keystonejs/fields-datetime-utc": "^6.0.4",
	"@keystonejs/fields-wysiwyg-tinymce": "^5.3.5",
	"@keystonejs/keystone": "^13.1.0"

I'm starting to feel like Keystone is gaslighting me. I just came back from a weekend break and without changing anything I get a new error without being able to roll back to a previous working point for some reason.

EDIT

I found the problem by looking through the change history of the files. I fixed it by installing @keystonejs/access-control@latest. For some reason I had most of the "internal" changes except the one made to list fields. I expect this move to bite me in the ass later when it prevents another update to install properly...

I guess this issue is now about the inconsistent states that can (and do) happen frequently.

Is there any solution to this or do we have to read through 50 keystone files everytime we upgrade anything? Sorry for the tone but my project broke 3 times because of this already and it's getting ridiculous. I love this project but this part of it is quite broken IMO.

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

1 participant