Closed oscarrc closed 4 years ago
I'm encountering this issue while trying to fetch a lyric:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined at String.format (@/node_modules/azlyrics-scraper/src/lyrics.js:6:31)
In order to solve this issue I've added the following line to lyrics.js line 42:
lyrics.js
let lyrics = $('.row .col-xs-12 div').each((_, e) => { if($(e).attr('class')) return; else if(!$(e).html()) return; //I've added this line else { $(e).html().format().split('\n').forEach(t => lyric.push(t)); }; });
Hope that helps.
Hello, Thanks for reporting this issue! Can you open a pull request for this fix? Thank you
I'm encountering this issue while trying to fetch a lyric:
In order to solve this issue I've added the following line to
lyrics.js
line 42:Hope that helps.