beardon / mws-api

Amazon Marketplace Web Services client for Node.js.
79 stars 55 forks source link

"Uncaught TypeError: exists is not a function" in Meteor app #73

Open monkeyman888 opened 7 years ago

monkeyman888 commented 7 years ago

I get the following error upon initializing the mws-api in my Meteor app. Any idea how to get around this issue? Running my code on Node directly from the console works fine so seems to be a Meteor issue?

modules.js?hash=c0646c9…:103512 Uncaught TypeError: exists is not a function at Function.getRoot (modules.js?hash=c0646c9…:103512) at bindings (modules.js?hash=c0646c9…:103414) at meteorInstall.node_modules.node-expat.lib.node-expat.js (modules.js?hash=c0646c9…:103224) at fileEvaluate (modules-runtime.js?hash=2b888cb…:207) at require (modules-runtime.js?hash=2b888cb…:130) at meteorInstall.node_modules.xml2json.lib.xml2json.js (modules.js?hash=c0646c9…:101709) at fileEvaluate (modules-runtime.js?hash=2b888cb…:207) at require (modules-runtime.js?hash=2b888cb…:130) at meteorInstall.node_modules.xml2json.lib.index.js (modules.js?hash=c0646c9…:101696) at fileEvaluate (modules-runtime.js?hash=2b888cb…:207) at require (modules-runtime.js?hash=2b888cb…:130) at meteorInstall.node_modules.xml2json.index.js (modules.js?hash=c0646c9…:101682) at fileEvaluate (modules-runtime.js?hash=2b888cb…:207) at require (modules-runtime.js?hash=2b888cb…:130) at meteorInstall.node_modules.mws-api.lib.client.js (modules.js?hash=c0646c9…:759) at fileEvaluate (modules-runtime.js?hash=2b888cb…:207)

dciccale commented 7 years ago

Apparently is related to xml2json package which uses node-expat. Maybe using npmjs.com/package/xml2js instead could be an option which is entirely done in js.

I am thinking on replacing this dependency with a pure js solution, it will also give us faster installation since it will not need to compile from C.

Edit: PR #75 is replacing this library, which could fix your issue. However it would be great if you could try out the next release with meteor.