AminoJS / Amino.JS

A powerful JavaScript library for interacting with the Amino API :star2:
MIT License
27 stars 5 forks source link

TypeError: Amino.AminoAPI is not a constructor #62

Closed tvortsa closed 5 years ago

tvortsa commented 5 years ago

Describe the bug I do try use version 3.0. in electron app. After > yarn start i get:

App threw an error during load TypeError: Amino.AminoAPI is not a constructor

To Reproduce Copy amino.js folder to app folder and > yarn add [path to amino.js folder]

yarn start

Expected behavior A clear and concise description of what you expected to happen.

Screenshots App threw an error during load TypeError: Amino.AminoAPI is not a constructor at Object. (F:\DEV\JS\electron\Amino\amifeya\src\index.js:8:18) at Module._compile (internal/modules/cjs/loader.js:808:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10) at Module.load (internal/modules/cjs/loader.js:677:32) at tryModuleLoad (internal/modules/cjs/loader.js:609:12) at Function.Module._load (internal/modules/cjs/loader.js:601:3) at loadApplicationPackage (F:\DEV\JS\electron\Amino\amifeya\node_modules\electron\dist\resources\default_app.asar\main.js:105:12) at Object. (F:\DEV\JS\electron\Amino\amifeya\node_modules\electron\dist\resources\default_app.asar\main.js:153:5) at Module._compile (internal/modules/cjs/loader.js:808:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10) at Module.load (internal/modules/cjs/loader.js:677:32) at tryModuleLoad (internal/modules/cjs/loader.js:609:12) at Function.Module._load (internal/modules/cjs/loader.js:601:3) at Object. (F:\DEV\JS\electron\Amino\amifeya\node_modules\electron\dist\resources\electron.asar\browser\init.js:197:8) at Module._compile (internal/modules/cjs/loader.js:808:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10) at Module.load (internal/modules/cjs/loader.js:677:32) at tryModuleLoad (internal/modules/cjs/loader.js:609:12) at Function.Module._load (internal/modules/cjs/loader.js:601:3) at Function.Module.runMain (internal/modules/cjs/loader.js:873:10) at internal/main/run_main_module.js:21:11

Desktop (please complete the following information):

Additional context me code is:

// - - - Amino - - - var Amino = require('amino.js'); // use the Amino.js api

const AminoAPI = new Amino.AminoAPI(); AminoAPI.proccessAction(Amino.login('myMail@gmail.com', 'mypass'), function(data) { // Here is the success handler console.log('AMINO LOGIN SUCCESSFULL !'); }, function(error) { // Here is the error handler console.log('AMINO LOGIN ERROR !'); }); // - - - Amino end - - -

akatsukilevi commented 5 years ago

Can you verify if the folder framework is listed at the Amino.JS you downloaded? Make sure you do have the 3.0.0-nightly build to use the AminoAPI wrapper

tvortsa commented 5 years ago

Yes i download wrong version of API, excuse me, its my stupid fault, im sorry (

(It will be good if version 3.0 will be available from >npm install)

akatsukilevi commented 5 years ago

It's fine, happens to me all the time XP (And i'm trying to merge the 3.0.0-nightly to the master branch, but i need @moelrobi @felixfong227 and @coffeeboo to approve it The pull request is still open