sanity-io / sanity-plugin-asset-source-cloudinary

Access and select photos from your Cloudinary account within the Sanity Studio.
MIT License
10 stars 4 forks source link

[breaking bug] TypeError: this.draft is null #2

Open ovsw opened 4 years ago

ovsw commented 4 years ago

✔️ Fresh install through Sanity Create of Gatsby blog profile. ✔️ Updated Sanity to latest package versions through sanity upgrade.

✔️ Installed and configured sanity-plugin-asset-source-cloudinary correctly. ✔️ Configured an image field to use Cloudinary as source.

✔️ On clicking 'select' button, the Cloudinary Media Widget opens for me to select an image. ❌ On making a selection, the widget closes but the image doesn't get selected in the image field.

Error message in browser console:

TypeError: this.draft is null                                 DocumentPane.js:751

This happens both locally and on deployed studio. Selecting an image from uploaded images works just fine.

And, of course, React freaks out with the following error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in ImageInput (created by SanityImageInput)
    in SanityImageInput (created by withDocument(SanityImageInput))
    in withDocument(SanityImageInput) (created by FormBuilderInput)
    in div (created by FormBuilderInput)
    in FormBuilderInput (created by Field)
    in div (created by Field)
    in Field (created by ObjectInput)
    in div (created by ObjectInput)
    in ObjectInput (created by FormBuilderInput)
    in div (created by FormBuilderInput)
    in FormBuilderInput (created by SanityFormBuilder)
    in FormBuilderContext (created by SanityFormBuilderContext)
    in SanityFormBuilderContext (created by SanityFormBuilder)
    in SanityFormBuilder (created by EditForm)
    in form (created by EditForm)
    in EditForm (created by FormView)
    in div (created by FormView)
    in FormView (created by DocumentPane)
    in div (created by ScrollContainer)
    in ScrollContainer (created by Pane)
    in div (created by Pane)
    in div (created by Pane)
    in Pane (created by Styleable(Pane))
    in Styleable(Pane) (created by TabbedPane)
    in TabbedPane (created by Styleable(TabbedPane))
    in Styleable(TabbedPane) (created by DocumentPane)
    in div (created by DocumentPane)
    in DocumentPane
    in StreamingComponent
    in StreamingComponent (created by Context.Consumer)
    in WithInitialValueWrapper (created by Pane)
    in Pane (created by DeskToolPanes)

Package versions:

"dependencies": {
    "@sanity/base": "^0.147.8",
    "@sanity/cli": "^0.147.8",
    "@sanity/components": "^0.147.9",
    "@sanity/core": "^0.147.9",
    "@sanity/dashboard": "^0.147.8",
    "@sanity/default-layout": "^0.147.9",
    "@sanity/default-login": "^0.147",
    "@sanity/desk-tool": "^0.147.9",
    "@sanity/studio-hints": "^0.147.8",
    "date-fns": "^1.30.1",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "sanity-plugin-asset-source-cloudinary": "^0.1.0",
    "sanity-plugin-dashboard-widget-document-list": "^0.0.9",
    "sanity-plugin-dashboard-widget-netlify": "^1.0.1",
    "sanity-plugin-media": "^0.2.10"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-config-standard-react": "^7.0.2",
    "eslint-plugin-import": "^2.17.3",
    "eslint-plugin-node": "^9.1.0",
    "eslint-plugin-promise": "^4.1.1",
    "eslint-plugin-react": "^7.13.0",
    "eslint-plugin-standard": "^4.0.0",
    "prettier-eslint-cli": "^4.7.1"
  }
kmelve commented 4 years ago

Hi – thanks for reporting! We need to look into this. Stay tuned!

skogsmaskin commented 4 years ago

This doesn't sound like a bug in the plugin to me, as it's happening inside the desk tool related to draft/published versions. Is it still happening @ovsw - with recent versions of the Sanity Studio?

Rinzlerte commented 4 years ago

problem is actual atm..