mux-video-react/package.jso module is not defined in ES module scope

21 Views Asked by At

I get this error during build, this is the last commit which was working perfectly before, I am not sure I am getting this error now: I am using Oxygen to deploy Hydrogen 1 commits.

Building client code ...
9:14:11 PM [vite] Error when evaluating SSR module /src/components/media/SanityMuxVideo.client.tsx?no-proxy:
ReferenceError: module is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/home/runner/work/penny-morrison/penny-morrison/node_modules/@mux/mux-video-react/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///home/runner/work/penny-morrison/penny-morrison/node_modules/@mux/mux-video-react/dist/index.cjs.js:1:601
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async nodeImport (/home/runner/work/penny-morrison/penny-morrison/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:50387:21)
    at async eval (/src/components/media/SanityMuxVideo.client.tsx?no-proxy:6:31)
    at async instantiateModule (/home/runner/work/penny-morrison/penny-morrison/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:50317:9)
    ```
0

There are 0 best solutions below