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

document-field example breaks post admin page when mention is used #7685

Closed
shendrick opened this issue Jul 1, 2022 · 2 comments · Fixed by #7700
Closed

document-field example breaks post admin page when mention is used #7685

shendrick opened this issue Jul 1, 2022 · 2 comments · Fixed by #7700
Assignees
Labels
🐛 bug Unresolved bug

Comments

@shendrick
Copy link

  1. Spin up the document-field example project
  2. Create a Post and add an author inline with 'mention'
  3. Click "Create Post".

Screen Shot 2022-07-01 at 3 14 28 PM

I expect the post to save correctly.

I get this error when trying to open the new post in the admin...

TypeError: Cannot read properties of undefined (reading 'mention')

Call Stack
normalizeInlineBasedOnLinksAndRelationships
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (1045:0)
normalizeElementBasedOnDocumentFeatures
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (1094:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (1111:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (3673:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (2563:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (70:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (2187:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (5066:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (2780:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (3468:0)
editor.normalizeNode
../../node_modules/@keystone-6/fields-document/dist/index-a4b44ebd.esm.js (6428:0)
eval
../../node_modules/slate/dist/index.es.js (1603:0)
Object.withoutNormalizing
../../node_modules/slate/dist/index.es.js (2229:0)
Object.normalize
../../node_modules/slate/dist/index.es.js (1565:0)
Object.deserialize
../../node_modules/@keystone-6/fields-document/views/dist/keystone-6-fields-document-views.esm.js (184:6)
eval
../../node_modules/@keystone-6/core/dist/useInvalidFields-99720f20.esm.js (32:0)
Array.forEach
<anonymous>
deserializeValue
../../node_modules/@keystone-6/core/dist/useInvalidFields-99720f20.esm.js (7:0)
eval
../../node_modules/@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/keystone-6-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.esm.js (88:34)
mountState
../../node_modules/react-dom/cjs/react-dom.development.js (16986:0)
Object.useState
../../node_modules/react-dom/cjs/react-dom.development.js (17699:0)
useState
../../node_modules/react/cjs/react.development.js (1622:0)
ItemForm
../../node_modules/@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/keystone-6-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.esm.js (87:36)
renderWithHooks
../../node_modules/react-dom/cjs/react-dom.development.js (16305:0)
mountIndeterminateComponent
../../node_modules/react-dom/cjs/react-dom.development.js (20074:0)
beginWork
../../node_modules/react-dom/cjs/react-dom.development.js (21587:0)
HTMLUnknownElement.callCallback
../../node_modules/react-dom/cjs/react-dom.development.js (4164:0)
Object.invokeGuardedCallbackDev
../../node_modules/react-dom/cjs/react-dom.development.js (4213:0)
invokeGuardedCallback
../../node_modules/react-dom/cjs/react-dom.development.js (4277:0)
beginWork$1
../../node_modules/react-dom/cjs/react-dom.development.js (27451:0)
performUnitOfWork
../../node_modules/react-dom/cjs/react-dom.development.js (26557:0)
workLoopSync
../../node_modules/react-dom/cjs/react-dom.development.js (26466:0)
renderRootSync
../../node_modules/react-dom/cjs/react-dom.development.js (26434:0)
performConcurrentWorkOnRoot
../../node_modules/react-dom/cjs/react-dom.development.js (25738:0)
workLoop
../../node_modules/scheduler/cjs/scheduler.development.js (266:0)
flushWork
../../node_modules/scheduler/cjs/scheduler.development.js (239:0)
MessagePort.performWorkUntilDeadline
../../node_modules/scheduler/cjs/scheduler.development.js (533:0)```

<!-- Please add contextual information such as your node version (node -v), or the web browser you used -->
@shendrick shendrick changed the title document-field example breaks post page when mention is used... document-field example breaks post admin page when mention is used... Jul 1, 2022
@shendrick
Copy link
Author

For some reason, it now lets me edit it again, but the relationships aren't dropdowns anymore and just hardcoded text..

Adding mention...
Screen Shot 2022-07-04 at 11 05 09 AM

After saving and reloading...
Screen Shot 2022-07-04 at 11 05 24 AM

@oguzhankurtulus
Copy link

Yeah, i have same issue.

When i upgraded @keystone-6/fields-document from "3.0.0" to "4.0.0", i faced with this bug.

@dcousens dcousens added the 🐛 bug Unresolved bug label Jul 9, 2022
@dcousens dcousens changed the title document-field example breaks post admin page when mention is used... document-field example breaks post admin page when mention is used Jul 9, 2022
@emmatown emmatown self-assigned this Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unresolved bug
Projects
None yet
4 participants