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
51 stars 55 forks source link

Plugin crashes Studio after update to Sanity v3.25.0 #343

Closed fo-rk closed 4 months ago

fo-rk commented 8 months ago

New studio update now crashes due to sanity-plugin-mux-input:

Error: Could not find `source` context
Error: Could not find `source` context
    at useSource (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-Z5C6ILHE.js?v=4a7eb198:47418:11)
    at useClient (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-Z5C6ILHE.js?v=4a7eb198:30826:18)
    at useClient2 (http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-mux-input.js?v=0ef2895f:47731:10)
    at Input (http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-mux-input.js?v=0ef2895f:51648:18)
    at renderWithHooks (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:17045:26)
    at updateFunctionComponent (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:19451:28)
    at updateSimpleMemoComponent (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:19332:18)
    at updateMemoComponent (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:19242:22)
    at beginWork (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:20839:22)
    at beginWork$1 (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-J3LK6LZ2.js?v=4a7eb198:24623:22)

Have updated UI to "@sanity/ui": "^2.0.0",

Any help much appreciated.

hdoro commented 5 months ago

@fo-rk can you confirm that this is still happening with plugin version ^2.3.4 and Sanity ^3.40.?

I could not reproduce the error.

hdoro commented 4 months ago

Assuming stale - feel free to ping if not :)

CassadyTransom commented 3 months ago

I am currently experiencing the same issue with Plugin version ^2.3.6 and sanity ^3.46.1.

Current Behavior: It occurs when trying to access the "Videos" in dashboard, or a video field in an entry.

Expected Behavior: Mux plugin would prompt for MUX API key and complete setup.

CassadyTransom commented 3 months ago

Looks like this has to do with Vite, as it works in production or local build, but not in local dev environment