Hagsten / Talkify

Javascript Text to speech library
216 stars 32 forks source link

promise is not defined #5

Closed KamilSocha91 closed 7 years ago

KamilSocha91 commented 7 years ago

Google Chrome 57.0.2987.110 (64-bit) Linux Ubuntu jQuery JavaScript Library v3.2.1

My solution, which worked:

Change: var p = new promise.Promise(); To: var p = new $.Deferred();

And: return p: To: return p.promise();

Hagsten commented 7 years ago

Hi lim169!

Have you included the Promise lib? Promise is a dependency, see https://github.com/Hagsten/Talkify#dependencies. We are trying to phase out jQuery from Talkify since jQuery is a "heavyweight" lib and we are not using many of its features as of now. Do not be suprised if the jQuery dependency is removed in the near future, therefore the $.Deferred will not work in the long run and you will most likely run into issues already since Talkify assumes the Promise libs API.

KamilSocha91 commented 7 years ago

Yes I tried to add promise.js, it not helped for me, maybe done something wrong. So far part which I am using is running great after that little change.

I would say removing JQuery is a great move :+1:

Hagsten commented 7 years ago

@lim169 Promise.js is now a part of our distributables in the /dist folder or by installing the bower/npm packages. jQuery dependency is also removed as of version 1.1.0.