zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
620 stars 136 forks source link

get error window is not defined #91

Closed morlz closed 7 years ago

morlz commented 7 years ago

using

node v8.4.0 telegram-mtproto v3.2.9

get error ReferenceError: window is not defined on evry api call. What am I doing wrong?

src: in file time-manager.js on line 13 code: if (!isNode) t += window.tsOffset || 0 dist: in file mtproto2-browser.js on line 1302 code: if (!__WEBPACK_IMPORTED_MODULE_0_detect_node___default.a) t += window.tsOffset || 0;

goodmind commented 7 years ago

why are you using mtproto2-browser.js ? Are you running code in browser or in nodejs?

morlz commented 7 years ago

i use import MTProto from 'telegram-mtproto' in nodejs

goodmind commented 7 years ago

hmm, it should be okay @zerobias

zerobias commented 7 years ago

@morlz Something going wrong on your side, because 3.2.9 even doesn't contain file mtproto2-browser (moreover you still doesn't need it)

Try to clean up your project, e.g. remove node_modules and run npm install again