-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
module.exports issue since 6.2.0 #4580
Comments
I've been thinking a lot about this, thanks for opening it here to remind me.
But you want something like
So, a potential solution is to just remove What are your thoughts @videojs/core-committers? |
Yeah, if this was an ecosystem breaking change and it doesn't hurt badly to fix that, I'd be in favor of the patch. Then revisiting with 7.0 and if it's worth the breaking change at that point, drawing a clear line in the sand, an plugins can report if they're 7.0+ compatible. 👍 |
Sounds good to me. |
The problem is the combination of ES6 exports
export default videojs
and requirejs importsrequire('video.js)
video.js switched from
module.exports = videojs
in 6.1.0 toexport default videojs
in 6.2.0And while videojs-record still uses require('video.js) and if you use ES6 stops working.
https://github.com/videojs/video.js/blob/v6.1.0/src/js/video.js#L727
https://github.com/videojs/video.js/blob/v6.2.0/src/js/video.js#L726
So the fix to this is as I understand it to switch to ES6 imports or to change the require to
require('video.js).default
But I'm not really an expert regarding this subject.
Explanations of this problem:
#2698 (comment)
https://medium.com/@kentcdodds/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution-ad2d5ab93ce0
More background info: collab-project/videojs-record#149
The text was updated successfully, but these errors were encountered: