Error when uploading video to Sanity using Mux plugin
26 replies
Last updated: May 15, 2020
C
Anyone had this error before?
May 14, 2020, 8:50 PM
H
I have had it on my frontend.. It occured when I was trying to pass
assetIdinstead of
_idinto imageUrlBuilder.. maybe you're doing the same
May 14, 2020, 8:52 PM
C
I’m getting this in the Studio, I was trying to upload a video to Sanity using the sanity-plugin-mux-input and it crashed to this screen. I get this every time I try and navigate to the document.
May 14, 2020, 8:53 PM
C
I’m not sure how to get rid of it
May 14, 2020, 8:54 PM
H
I understood you was in the studio, but thought you maybe did some hacking in the studio.. it's a good question how to delete the document.. I don't use groq but maybe you can solve it with https://www.sanity.io/docs/http-mutations
May 14, 2020, 8:56 PM
J
Are you able to get a hold of the JSON for that document?
Kind of looks like it expecting to get an image asset and gets something else.
Kind of looks like it expecting to get an image asset and gets something else.
May 15, 2020, 8:00 AM
C
Do you have any suggestions on how to? I’m pretty new to Sanity. I can’t use the inspector as the screen above stops me.
May 15, 2020, 11:56 AM
J
Can you do
sanity documents get your-document-id --pretty
May 15, 2020, 12:08 PM
J
also it would be helpful if you could post the schema for the document type that is failing
May 15, 2020, 12:09 PM
C
Thanks for the swift reply
May 15, 2020, 12:18 PM
C
The schema is:
May 15, 2020, 12:19 PM
C
import { MdFolder } from 'react-icons/md' export default { name: 'project', type: 'document', title: 'Work', icon: MdFolder, fields: [ { name: 'title', title: 'Title', type: 'string', }, { name: 'slug', title: 'Slug', type: 'slug', options: { source: 'title', maxLength: 96, }, }, name: 'thumbnails', title: 'Thumbnails', type: 'array', layout: 'grid', of: [ { type: 'image', options: { metadata: ['exif', 'location', 'palette', 'lqip'], }, }, { type: 'muxVideo' }, ], }, { name: 'gallery', title: 'Gallery', type: 'array', layout: 'grid', of: [{ type: 'image' }, { type: 'muxVideo' }], }, ], preview: { select: { title: 'title', media: 'thumbnails.0', }, }, }
May 15, 2020, 12:19 PM
C
And the mux field is:
May 15, 2020, 12:20 PM
C
export default { title: 'Video', name: 'muxVideo', type: 'mux.video', }
May 15, 2020, 12:20 PM
C
How do I get the document id?
May 15, 2020, 12:20 PM
J
Hm... it should be in the url in your browser
May 15, 2020, 12:21 PM
J
if you post the url when you click the document I can dig it out for you 🙂
May 15, 2020, 12:22 PM
C
This is what’s in the URL when I hit that screen
May 15, 2020, 12:23 PM
C
May 15, 2020, 12:23 PM
J
can you right click and do copy link address on the document?
May 15, 2020, 12:24 PM
J
(in the document list)
May 15, 2020, 12:24 PM
C
The stack trace comes up before I can interact with the document list
May 15, 2020, 12:26 PM
J
Hm, ok, then it's probably related to your preview. Try removing that
May 15, 2020, 12:28 PM
J
media: 'thumbnails.0',<-- remove that
May 15, 2020, 12:28 PM
C
Oh good point. It all works now
May 15, 2020, 12:29 PM
C
Thanks very much for your help. I should’ve realised that
May 15, 2020, 12:30 PM
J
No problem, glad we figured it out!
May 15, 2020, 12:33 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.