routayush1 / animexninja

Anime Streaming Web App built with NextJS
179 stars 88 forks source link

Unhandled Rejection (TypeError): data.links[0] is undefined #1

Closed icewyvrn closed 3 years ago

icewyvrn commented 3 years ago

Unhandled Rejection (TypeError): data.links[0] is undefined Watch/</< src/pages/watch.js:113

110 | .then(res=> res.json())
  111 | .then(data =>{
  112 |   if(data.links.length>=1||data.link.length>=2){
> 113 |     if(data.links[0].label==="hls P"){
      | ^  114 |       setIfr(true)
  115 |       setUrl(data.link)
  116 |     }

Unhandled Rejection (TypeError): data.links[0] is undefined Watch/</< http://localhost:3000/static/js/main.chunk.js:2859:13

2856 | Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
  2857 |   fetch(uri).then(res => res.json()).then(data => {
  2858 |     if (data.links.length >= 1 || data.link.length >= 2) {
> 2859 |       if (data.links[0].label === "hls P") {
       |           ^  2860 |         setIfr(true);
  2861 |         setUrl(data.link);
  2862 |       } else {
routayush1 commented 3 years ago

have updated and solved the issue ,clone again

icewyvrn commented 3 years ago

can you block the ads in the player?

routayush1 commented 3 years ago

No,the backend of this website is being scraped from gogoanime, we have no ads in the entire website but we cannot remove it from the video player

routayush1 commented 3 years ago

we have completely remove ads in the entire website even from the video player

icewyvrn commented 3 years ago

what commit is that?

routayush1 commented 3 years ago

The lastest one!!