Comments (5)
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.
Thanks @KimPaow and @rexxars !
from sanity-plugin-mux-input.
@And3y thanks for surfacing, we'll take a look at this!
from sanity-plugin-mux-input.
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.
@judofyr Yes, we're working on this and you should see a new release very soon.
from sanity-plugin-mux-input.
Related Issues (20)
- TypeError: Cannot read properties of null (reading 'includes') HOT 1
- W.createUpload is not a function HOT 21
- Error while uploading video in sanity studio deployed to vercel HOT 1
- The mux-input plugin crashed: Invalid credentials HOT 2
- videos are displayed twice in sanity HOT 4
- ESM issue with Next.js back in v.2.2.0 HOT 1
- No way to clear credentials? HOT 2
- Thumbnail support gone? HOT 3
- 4k support HOT 2
- Issue with styled-components HOT 2
- Not able to "log out" from the plugin using the Access Tokens for client usage. HOT 4
- Support for auto-generated captions HOT 3
- Cannot read properties of undefined (reading 'dataset') HOT 5
- Revalidate API token HOT 6
- No playbackid returned from sanity query HOT 2
- Add Support for Styled Components v6 HOT 2
- Inability to upload large files (from local machine or from google drive) HOT 2
- There is no way to choose between Baseline assets and Smart assets pricing HOT 3
- Cannot access videos already uploaded to the MUX HOT 5
- Plugin crashes Studio after update to Sanity v3.25.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sanity-plugin-mux-input.