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

TypeError: "exports" is read-only #12

Open
LivingWithHippos opened this issue Sep 9, 2020 · 0 comments
Open

TypeError: "exports" is read-only #12

LivingWithHippos opened this issue Sep 9, 2020 · 0 comments

Comments

@LivingWithHippos
Copy link

Hello, I'm trying to use this for a personal project but I'm running into this issue.
My class is like this:

import React from 'react';

import { MediaPlayer } from 'win95-media-player';

const VideoPlayer = ({onHide, video, title}) => {

    const _handleClose = () => {
        onHide('lettoreVideo')
    };

    const playlist = [
        {
            url: '../assets/' + video,
            title: title? title : 'Windows Media Player'
        }
    ];

    return (
            <div className="players-container">
                <MediaPlayer
                    className="player"
                    playlist={playlist}
                    showVideo
                    fullscreenEnabled
                />
            </div>
    );
}

export default VideoPlayer;

But upon adding and running it i get the error

./node_modules/win95-media-player/lib/components/ProgressControl.js/<
C:/Users/user/Documents/GitHub/project/node_modules/win95-media-player/lib/components/ProgressControl.js:255

  252 |   return ProgressControl;
  253 | }(React.PureComponent);
  254 | 
> 255 | module.exports = playerContextFilter(ProgressControl, ['currentTime', 'duration', 'onSeekComplete']);

Cheking the internet and the ProgressControl.js file it seems like you can't mix

import MediaBtn from './MediaBtn';

together with

module.exports = playerContextFilter(ProgressControl, ['currentTime', 'duration', 'onSeekComplete']);

but instead you should use

export default playerContextFilter(ProgressControl, ['currentTime', 'duration', 'onSeekComplete']);

which kinda fix the error (if I change it in the node_modules folder) but I run into other issues.
I'm not good with react or even js so I can't really help, I could't even understand where that file comes from ;p

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

1 participant