[Solved] Patch upgrade 1.4.1.1 -> 1.4.1.3 broke my Twitter functionality

when i did the patch upgrade, i saw that twitter-config-ui package was added (i am using Blaze, fwiw). i also saw that our functionality to post an item in our app to Twitter also broke.

this line exists in our server code:

let client = new Twitter(options);

in 1.4.1.1, that line runs fine. it does not after the upgrade:

Exception while invoking method 'v1/postNewsItemTweet' TypeError: Twitter is not a function

i’m using Webstorm, and i see that when i go to its reference, it’s resolves differently with the 2 versions.

when it works (1.4.1.1), it picks up Twitter from:

~/.meteor/packages/twitter/1.1.12/web.browser/twitter_client.js

when it doesn’t work (1.4.1.3), it picks up Twitter from:

~/.meteor/packages/twitter-oauth/1.2.0/web.browser/twitter_common.js

we’re using this package:

can anyone explain what happened and how i can going again w/ 1.4.1.3? i don’t know if i need to import Twitter from somewhere specific, if i need to completely redo how we tweet from the app, or something else.

fwiw, i also tried a full upgrade to v1.4.3.2 and behaviour is the same as i describe above.

ok i solved it.

i ditched the lablancas package and used the twitter npm package directly. i imported the package like this:

let Twitter = require('twitter');

and used it like this:

let postAsync = Meteor.wrapAsync(function(client, path, params, callback) {
	client.post(path, params, callback);
});

let client = new Twitter(options);

postAsync(client, endpoint, status, function(error, tweet, response) {
   // stuff
});

i also upgraded to latest Meteor, v1.4.3.2.