Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Component crashes since 2.5 update #908

Closed
1 task done
KubaniGal opened this issue Apr 22, 2024 · 9 comments · Fixed by #996
Closed
1 task done

Bug: Component crashes since 2.5 update #908

KubaniGal opened this issue Apr 22, 2024 · 9 comments · Fixed by #996
Labels
bug Something isn't working Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@KubaniGal
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-player-react

Which browsers are you using?

Chrome

Which operating systems are you using?

macOS

Description

Hi, ever since mux player react version updated to 2.5 (4 days ago) the component fails, i reverted back to 2.4.1 for now, but i wanted to report this to make sure it handled, this happens both locally and when running github checks.
when i reverted back to 2.4.1 the issue was resolved so it must have been the latest version update
this is the call stack and error:

mux.cjs.js:1 Uncaught TypeError: ue.default.getLevel is not a function
at ../node_modules/mux-embed/dist/mux.cjs.js (mux.cjs.js:1:17456)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:61:1)
at ../node_modules/@mux/playback-core/dist/index.cjs.js (index.cjs.js:1:1777)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:61:1)
at ../node_modules/@mux/mux-player-react/dist/index.cjs.js (index.cjs.js:1:801)
at options.factory (react refresh:6:1)

Thanks in advance.

Reduced test case

No response

Steps to reproduce

  1. delete and reinstall node modules(if needed) with version 2.5
  2. run locally and open localhost
  3. should see the error

Current Behavior

fails to navigate to app

Expected Behavior

should work as it did in previous versions

Errors

mux.cjs.js:1 Uncaught TypeError: ue.default.getLevel is not a function
at ../node_modules/mux-embed/dist/mux.cjs.js (mux.cjs.js:1:17456)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:61:1)
at ../node_modules/@mux/playback-core/dist/index.cjs.js (index.cjs.js:1:1777)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:61:1)
at ../node_modules/@mux/mux-player-react/dist/index.cjs.js (index.cjs.js:1:801)
at options.factory (react refresh:6:1)

What version of the package are you using?

2.5

@KubaniGal KubaniGal added bug Something isn't working Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Apr 22, 2024
@cjpillsbury
Copy link
Contributor

Hey @KubaniGal we may need some more details to be able to help investigate this, since we have many use cases of mux player react and haven't yet run into this problem. Is there any chance you can share a simplified reproduction case, like a github repo, codesandbox, or the like?

@KubaniGal
Copy link
Author

Hey, thanks for the reply..
i hope this will help, this is how we use the player in our project:

  <MuxPlayer
    data-hook={"mux-player"}
    style={{ height: "100%" }}
    streamType="on-demand"
    playbackId={recordedId}
  />

not sure i have more to provide, this works fine in any version that isnt 2.5, in 2.5 the error shows as i attached above

@scmilee
Copy link

scmilee commented Apr 24, 2024

We are also experiencing this issue when bumping to 2.5.0 from 2.4.x . We are bundling the mux-player-react in with our internal components library and when consuming the library from either our main React app or a create-react-app --template typescript we get the same type error as above.

Interestingly enough, when we directly import and consume mux-player-react in the create-react-app, everything works fine. Additionally, everything works fine in both scenarios when rolling back to 2.4.2. I see in the release for 2.5.0 a d.ts file was removed for mux-embed and maybe that has something to do with it?

Not exactly sure what would cause this nested dependency type issue.

note: mux-player-react is listed as a peerDependency in our internal component library if that makes a difference

@cjpillsbury
Copy link
Contributor

@KubaniGal @scmilee If either of you can share a codebase + steps to reproduce (codesandbox, stackblitz, public github repo) for the issue, that would go a long way. We and our customers use Mux Player across many react setups that appear to be working fine, so there's almost definitely some other detail in the setup (react versions, build tools, etc. etc.) that's causing the issue to show up.

scmilee added a commit to scmilee/908-reproduction that referenced this issue May 6, 2024
@scmilee
Copy link

scmilee commented May 6, 2024

Here is the sandbox, if the runtime error isn't covering the preview page it's in the terminal. And as mentioned before, direct usage of the lib will work, only seems to be an issue when it's bundled a level down.

Lib repo
ts react app repo

@abhisheklalnediya
Copy link

I am also facing this issue.

@czynskee
Copy link

I ran into the same issue here. I was able to fix it by adding this to my webpack config:

const config = {
  resolve: {
    extensions: [".js", ".ts", ".tsx"],
    alias: {
      "@mux/mux-player-react": pathLib.resolve(__dirname, "../node_modules/@mux/mux-player-react/dist/index.mjs"),
      }
   }
}

@czynskee
Copy link

czynskee commented Sep 14, 2024

I ran into this issue as well.

I fixed the problem with this:

const config = {
  resolve: {
    alias: {
      "@mux/mux-player-react": pathLib.resolve(__dirname, "../node_modules/@mux/mux-player-react/dist/index.mjs")
     }
  }
}

I have multiple sub-packages in my project which is why node_modules is one level up from the webpack config. Not sure if that's related to the root cause.

cjpillsbury added a commit that referenced this issue Sep 27, 2024
… 5.3.1 due to build issues in more complex build setups. (#996)

**NOTE**: Although our new semver matchers allow for newer versions of
mux-embed to be installed (so long as yarn.lock, package-lock.json,
package-shrinkwrap.json of uses don't get in the way), we should still
update the min version, since 5.3.0 will break Mux Player (et al.) for
some build setups for integrators.

fixes #908
@cjpillsbury
Copy link
Contributor

Hey there folks! We finally were able to prioritize this and dig into root cause. The short version:

  • Root cause was actually due to changes in our data sdk library, mux-embed, which have been resolved and released in mux-embed@5.3.1
  • You should be able to resolve right now by upgrading to the current latest version of Mux Player (or Mux Player React) and just making sure mux-embed@5.3.1 is installed (aka make sure any yarn.lock, package-lock.json, or npm-shrinkwrap.json don't unintentionally block installing the latest patch of mux-embed).
    • You can confirm the version using npm ls --all mux-embed or yarn list mux-embed
  • Although this is a major version bump, it's basically fully backwards compatible, with the following exceptions
    • We've added basic tooltip support, which is on by default. If you want tooltips disabled, set no-tooltips attr or noTooltips prop.
    • "under the hood" with our UI, our menus have been completely rearchitected. There's one advanced use case backwards compatibility bug that's on our radar that we will be resolving ASAP: we do not currently have player-specific css vars if you want to hide any menu item controls. There are currently workarounds if you use this advanced feature: just let me know!
  • In our next release of Mux Player, mux-embed@^5.3.1 will be enforced (see PR mentioned here) and the aforementioned menu css var bug will be resolved. This should happen sometime next week, if you just wanted to wait.

Let me know if there are any questions/comments/concerns here or if you're still having issues after doing ☝️. Sorry for the delay on us being able to prioritize this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
5 participants