player.js: TypeError when embedding player

Expected Behavior

Vimeo player should function without Javascript errors.

Actual Behavior

Vimeo player throws the following error:

player.js:2 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'indexOf')
    at player.js:2:17262
    at Array.forEach (<anonymous>)
    at z (player.js:2:17236)
    at c._onMessage (player.js:2:26203)

Note that video player will still work.

Steps to Reproduce

Run the documentation embed example in any modern browser. https://jsfiddle.net/fvewbhr0/

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 17
  • Comments: 20 (5 by maintainers)

Most upvoted comments

Thank you all for your patience. We pushed out a change to resolve this. Appreciate the community reporting this issue. I am going to close this, but please feel free to file a new issue if you are still experiencing this.

Thanks for reporting this issue. We’re looking into this right now. We have identified this issue as being related to a recent release. For those impacted, please share if you’re observing any behavioral impact as a result of this issue.

Hello, I am also experiencing this scenario, I am using mac M1 mini using Chrome Version 125.0.6422.142. It was working fine yesterday, no change in code.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'indexOf')
    at player.es.js:1251:1
    at Array.forEach (<anonymous>)
    at processData (player.es.js:1250:1)
    at _this._onMessage (player.es.js:2163:1)

I have one user experiencing this error. The video still plays.

from my error reporting: undefined is not an object (evaluating ‘e.href.indexOf’)

version v2.23.0, https://github.com/vimeo/player.js

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

I ignore the error, and the video still plays. My workaround until it is fixed.

 onError(error) {
      /**
       * Issue from @vimeo/player v2.20.1 that happen 14 Jun of 2024
       * Follow up: https://github.com/vimeo/player.js/issues/1034
       */
      if (error?.message.includes('Cannot read properties of undefined')) {
        return
      }  
     ````

Be aware that the error message may differ per browser.

In Safari undefined is not an object (evaluating 'e.href.indexOf')

I ignore the error, and the video still plays. My workaround until it is fixed.

 onError(error) {
      /**
       * Issue from @vimeo/player v2.20.1 that happen 14 Jun of 2024
       * Follow up: https://github.com/vimeo/player.js/issues/1034
       */
      if (error?.message.includes('Cannot read properties of undefined')) {
        return
      }  
     ````

Here for the same issue. It seems something changed on iOS more specifically as this only became an issue today (13/06)

Using it with react-player

TypeError: undefined is not an object (evaluating 'e.href.indexOf')
  at <anonymous> @ https://player.vimeo.com/api/player.js:2:17271
  at forEach @ [native code]
  at z @ https://player.vimeo.com/api/player.js:2:17243
  at <anonymous> @ https://player.vimeo.com/api/player.js:2:26204

@egachi This was an incidental regression that occurred due to a code refactor.

@weeblr Yes. I should have been more clear. There will be no related update to this package. And thanks again for jumping in. Please reach out with any issues or questions.