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

Uncaught Error: No encoding-indexes.js #386

Open
tvpmb opened this issue Feb 21, 2020 · 2 comments
Open

Uncaught Error: No encoding-indexes.js #386

tvpmb opened this issue Feb 21, 2020 · 2 comments

Comments

@tvpmb
Copy link

tvpmb commented Feb 21, 2020

Just encountered this intermittent issue with the vtt.min.js library. When loaded in a browser, it occassionally throws this error and stops execution:

image

Sometimes it blocks execution, sometimes it works, either way when in the context of a web browser this is not needed, per the code comments:

// If we're in node require encoding-indexes and attach it to the global.
if (typeof module !== "undefined" && module.exports) {
  this["encoding-indexes"] = require("./encoding-indexes.js")["encoding-indexes"];
}

Any ideas? We're going to remove it at this point from our build...

@UdaySahni
Copy link

UdaySahni commented Aug 27, 2020

Hi tvpmb, I am getting a similar issue on my end when introducing vtt.js as a dependency. Did removing the code block above work for you?

@gkatsev
Copy link
Contributor

gkatsev commented Aug 27, 2020

That piece of code comes from https://github.com/inexorabletash/text-encoding/blob/3f330964c0e97e1ed344c2a3e963f4598610a7ad/lib/encoding.js#L11-L16.
It's likely that if you're using the dist file of vtt.js and things get compiled into one file, it's not loading from the right directly.
FWIW, in the Video.js fork of vtt.js we've removed the dependency on text-encoding as most of the time it isn't an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants