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

SSR - Cannot read property 'unsubscribe' of undefined #32

Closed
djabif opened this issue Sep 26, 2020 · 5 comments · Fixed by #73
Closed

SSR - Cannot read property 'unsubscribe' of undefined #32

djabif opened this issue Sep 26, 2020 · 5 comments · Fixed by #73
Labels
bug Something isn't working has PR Has a PR help wanted Extra attention is needed
Projects

Comments

@djabif
Copy link

djabif commented Sep 26, 2020

Description

I'm getting the error: "TypeError: Cannot read property 'unsubscribe' of undefined at VgMediaDirective.ngOnDestroy" in SSR.
I'm using Angular 10.
This issue was also reported in the previous version of this library videogular/videogular2#888

Expected Behavior

Videogular library should be able to load in server side.

Actual Behavior

Videogular throws this error and doesn't load.

Steps to Reproduce

  1. Add videogular to an Angular 10 app
  2. Add a video player to a component
  3. Build the app with ssr
@itsbrianburton
Copy link

Did you add the [vgMedia] directive to the

@djabif
Copy link
Author

djabif commented Oct 9, 2020

Yes, I'm using it like this.

<video controls #player_video [vgMedia]="player_video" id="player-video" preload="auto">
	<source [src]="video.src" [type]="video.type">   
</video>

@IxquitilisSaid IxquitilisSaid added bug Something isn't working help wanted Extra attention is needed labels Nov 17, 2020
@IxquitilisSaid IxquitilisSaid added this to Triage (Looking into it) in Roadmap May 21, 2021
@patelreez
Copy link

I had a similar issue earlier where I had put vg-controls outside vg-player. Maybe there should be a check in this library around this. It's just for good developer experience.

@guillermodelagala
Copy link
Contributor

I'm using Angular 12 and the same problem here. In my case vg-controls are inside vg-player.

guillermodelagala added a commit to guillermodelagala/ngx-videogular that referenced this issue Oct 14, 2021
IxquitilisSaid added a commit that referenced this issue Oct 18, 2021
@IxquitilisSaid IxquitilisSaid linked a pull request Oct 18, 2021 that will close this issue
@IxquitilisSaid IxquitilisSaid moved this from Triage (Looking into it) to Waiting to Deploy in Roadmap Oct 18, 2021
@IxquitilisSaid IxquitilisSaid added the has PR Has a PR label Oct 18, 2021
@IxquitilisSaid IxquitilisSaid moved this from Waiting to Deploy to Done in Roadmap Oct 19, 2021
@IxquitilisSaid
Copy link
Member

Just published v4.2.0! Massive thanks to @guillermodelagala for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has PR Has a PR help wanted Extra attention is needed
Projects
Roadmap
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants