Error when uploading video to Sanity using Mux plugin

26 replies
Last updated: May 15, 2020
Anyone had this error before?
AI Update

I'd be happy to help you troubleshoot an error! However, I don't see the actual error message in your question.

To help you effectively, I'll need to know:

  • The error message - the exact text of the error you're seeing
  • Where it's occurring - in Sanity Studio, during a build, in your frontend application, etc.
  • What you were doing - what action triggered the error (deploying, querying content, installing packages, etc.)

Common Sanity errors and their solutions include:

Studio/Build errors: Often related to Node.js version compatibility (Studio v4 requires Node 20+), missing dependencies, or configuration issues in sanity.config.ts

Query errors: Usually GROQ syntax issues or trying to access fields that don't exist

Authentication errors: API token problems or CORS configuration issues

Deployment errors: Can be related to environment variables, build settings, or hosting platform configuration

Once you share the specific error message, I or someone else in the community can point you to the exact solution. Feel free to paste the full error output - the more context, the better!

I have had it on my frontend.. It occured when I was trying to pass
assetId
instead of
_id
into imageUrlBuilder.. maybe you're doing the same
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.
I’m not sure how to get rid of it
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
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.
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.
Can you do
sanity documents get your-document-id --pretty
also it would be helpful if you could post the schema for the document type that is failing
Thanks for the swift reply
The schema is:
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',
        },
    },
}
And the mux field is:
export default {
    title: 'Video',
    name: 'muxVideo',
    type: 'mux.video',
}
How do I get the document id?
Hm... it should be in the url in your browser
if you post the url when you click the document I can dig it out for you 🙂
This is what’s in the URL when I hit that screen
can you right click and do copy link address on the document?
(in the document list)
The stack trace comes up before I can interact with the document list
Hm, ok, then it's probably related to your preview. Try removing that
media: 'thumbnails.0',
<-- remove that
Oh good point. It all works now
Thanks very much for your help. I should’ve realised that
No problem, glad we figured it out!

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?