TypeError: Cannot read property 'tt1156398' of undefined
Closed this issue · 8 comments
I am on Ubuntu 16.04 LTS, I've successfully installed your package with npm i yifysubtitles --save
although I got some warnings:
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.
But every time I try to run your example on the front page with node I am getting the following error:
TypeError: Cannot read property 'tt1156398' of undefined
at runConditional (/root/node_modules/yifysubtitles/index.js:64:37)
at apiCall.then.res (/root/node_modules/yifysubtitles/index.js:82:42)
at process._tickCallback (internal/process/next_tick.js:109:7)
Any ideas on how to fix this?
I'm going to look at this.
The api is currently in maintenance I'm going to add a test to cover this case.
http://api.yifysubtitles.com/subs/tt1935859
I add a condition to prevent this error and give the yifi api message to the user.
Hey, since the yify api status is still in maintenance I change the module a bit to make it work with scraped subtitles link.
Thanks a lot man! This means a lot to me :)
Now getting:
let writed = '';
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/a2g.js:1:85)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
What version of node are you using ? I use a lot of es6 available since node 6. Can you upgrade your node version ? I recommand https://github.com/creationix/nvm for using nodejs and manage versions The latest stable version of node is 7.8.
Alright works now, was using an older version.