Code Monkey home page Code Monkey logo

Comments (5)

dylanjha avatar dylanjha commented on August 23, 2024 2

Found it! with @KimPaow 😅

media-chrome will try to detect server-side environments and shim out the window functionality that it relies upon in order to prevents things like this. It does so by using this windowShim

The problem is here

export const isServer = !!(typeof window === 'undefined')
export const Window = isServer ? windowShim : window;

It turns out, in this sanity environment where the sanity graphql deploy command gets run window is not undefined. There already is a window defined, however that window does not have customElements. That's why it leads to this error of Cannot read property 'get' of undefined

I think the solution here might be for media-chrome to do a more robust check for isServer instead of checking !!(typeof window === 'undefined) we could do something more like:

export const isServer = !!(typeof window === 'undefined' || typeof window.customElements === 'undefined')

from sanity-plugin-mux-input.

dylanjha avatar dylanjha commented on August 23, 2024 1

Thanks @KimPaow and @rexxars !

from sanity-plugin-mux-input.

dylanjha avatar dylanjha commented on August 23, 2024

@And3y thanks for surfacing, we'll take a look at this!

from sanity-plugin-mux-input.

judofyr avatar judofyr commented on August 23, 2024

This has now been fixed in media-chrome v0.1.1, but we're depending on v0.0.15. I'm guessing we'll have to upgrade the dependency here as well?

from sanity-plugin-mux-input.

KimPaow avatar KimPaow commented on August 23, 2024

@judofyr Yes, we're working on this and you should see a new release very soon.

from sanity-plugin-mux-input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.