brightcove / react-player-loader

A React component that embeds and loads Brightcove Player scripts.
Other
21 stars 22 forks source link

version 1.5 cannot be imported due to missing dist dir #125

Open asipple1 opened 2 weeks ago

asipple1 commented 2 weeks ago

When attempting to import ReactPlayerLoader from @brightcove/react-player-loader using the latest version (1.5), I encountered the following error: Internal server error: Failed to resolve import "brightcove/react-player-loader". However, after downgrading to version 1.4.2, the issue is resolved, and everything works as expected. Upon further investigation, I observed that version 1.5 appears to be missing the dist directory, which is present in version 1.4.2.

Screenshot of version 1.5 in my node_modules

Screenshot 2024-09-12 at 7 17 13 AM

Screenshot of version 1.4.2 in my node_modules

Screenshot 2024-09-12 at 7 17 56 AM

GerryP2 commented 3 days ago

I have created our own declare module to bypass this.

brightcove-react-player-loader.d.ts

declare module '@brightcove/react-player-loader' {
    import * as React from 'react';

    export interface ReactPlayerLoaderProps {
      accountId: string;
      playerId: string;
      videoId?: string | number | undefined; 
      onSuccess?: (success: any) => void;
      onFailure?: (success: any) => void;
    }

    const ReactPlayerLoader: React.ComponentType<ReactPlayerLoaderProps>;
    export default ReactPlayerLoader;
}