Can not upload image inside code block
See original GitHub issueDescribe the bug When I try to upload an image inside Code Block. I received an error is:
Uncaught (in promise) TypeError: Cannot read property 'find' of undefined
at mediaLibrary.js:299
at index.js:8
at redux.js:475
at MediaLibrary.js:151
at Object.Gg (react-dom.production.min.js:155)
at Fg (react-dom.production.min.js:13)
at Ig (react-dom.production.min.js:13)
at be (react-dom.production.min.js:15)
at Jg (react-dom.production.min.js:156)
at Ic (react-dom.production.min.js:15)
To Reproduce
- Go to localhost:8000/admin
- Click on New Blog
- Click on new Image inside Code Block
- Try to upload an image
- See error at console
Expected behavior I want to can upload an image without any error
Screenshots
Applicable Versions:
- Netlify CMS app version: [2.10.1]
- Git provider: [GitHub]
- OS: [Windows 10]
- Browser version: [79.0.3945.88]
- Node.JS version: [v10.16.0]
CMS configuration
backend:
name: git-gateway
branch: master
media_folder: static/img
public_folder: /img
publish_mode: editorial_workflow
collections:
- name: "blog"
label: "Blog"
folder: "src/blog-posts"
create: true
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
editor:
preview: true
fields:
- { label: "Title", name: "title", widget: "string" }
- {
label: 'Publish Date',
name: 'date',
widget: 'datetime',
dateFormat: 'YYYY-MM-DD',
timeFormat: 'HH:mm',
format: 'YYYY-MM-DD HH:mm',
}
- { label: "Description", required: false, name: "description", widget: "string" }
- { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' }
- {
label: "Tags",
name: "tags",
widget: "select",
options: ['ReactJs', 'JavaScript', 'Redux', 'NodeJs'],
multiple: true
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
It's possible to create a code block with an image inside #9567
Click Insert code block. Result: A code block with image inside is created. Expected: Code block cannot contain images. Screencast:.
Read more >How To Use <img> To Upload Photos Via The Code Block?
I am trying to add images to my site via html using the <img> tag. I cannot for the life of me get...
Read more >Unable to upload image in a block. - Optimizely World
Hi,. I'm getting image upload failed message (Content type "ImageFile" is not allowed to be created under parent of content type "BannerBlock".
Read more >Why should I not upload images of code/data/errors?
Code or sample data in images can't be copied and pasted into an editor and compiled in order to reproduce the problem. Images...
Read more >Image Upload not always visible in MVC Content Block
When inspecting the view source, the "Upload image" is present in both cases - when it is visible and when not. In order...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@erquhart , I resolved this issue by an update to 2.10.3. Thank for your support.
Just released 2.10.3, can you update and see if it still happens?