sanity-io / sanity-plugin-mux-input

An input component that integrates Sanity Studio with MUX.com video encoding/hosting service.
https://mux.com
MIT License
45 stars 55 forks source link

MUX plugin crashes Sanity's new Typegen script #359

Closed mklasinc closed 2 months ago

mklasinc commented 2 months ago

Describe the bug

MUX video plugin crashes Sanity's new Typegen script script, which prevents Sanity users from using the Typegen feature on projects using the MUX plugin.

To Reproduce

Steps to reproduce the behavior:

  1. Include the MUX plugin in sanity.config.ts and add a MUX input field to one of the document schemas
  2. run npx sanity schema extract in the terminal
  3. The script should throw the following TypeError
    
    ✖ Failed to extract schema

TypeError: Failed to load configuration file "/Users/miha.klasinc/Documents/GitHub/portfolio/sanity.config.ts": l.matchMedia is not a function at jo (~/Documents/GitHub/portfolio/node_modules/@mux/mux-player/dist/index.cjs.js:145:8374) at Object. (~/Documents/GitHub/portfolio/node_modules/@mux/mux-player/dist/index.cjs.js:145:8586) at Object.newLoader [as .js] (~/Documents/GitHub/portfolio/node_modules/sanity/node_modules/esbuild-register/dist/node.js:2262:9) at extensions..js (~/Documents/GitHub/portfolio/node_modules/sanity/node_modules/esbuild-register/dist/node.js:4838:24)


**Expected behavior**

Type generation script should complete without issues and correctly extract project schemas, including for MUX video inputs.

**Which versions of Sanity are you using?**

@sanity/cli (global) 3.37.2 (up to date) @sanity/icons 2.11.8 (up to date) @sanity/image-url 1.0.2 (up to date) @sanity/types 3.37.2 (up to date) @sanity/ui 2.1.2 (latest: 2.1.3) @sanity/vision 3.27.1 (latest: 3.37.2) sanity 3.37.2 (up to date)


**What operating system are you using?**
Mac

**Which versions of Node.js / npm are you running?**

10.2.4 v20.11.1

michaelcpuckett commented 2 months ago

+1

14850842 commented 2 months ago

+1

sgulseth commented 2 months ago

Thanks for reporting. A fix for this will be part of the next release, which should happen next week,

mklasinc commented 2 months ago

Super, thanks for the awesome work in creating and maintaining this plugin!

diboune commented 2 months ago

hey @sgulseth when is the next release? thanks

sgulseth commented 2 months ago

@diboune It should come out later today!

sgulseth commented 2 months ago

Released https://github.com/sanity-io/sanity/releases/tag/v3.40.0