flatware icon indicating copy to clipboard operation
flatware copied to clipboard

Tabletop undefined when run with browserify

Open tmfrnz opened this issue 8 years ago • 0 comments

I am getting a "Tabletop undefined" error on my injected script with the API callback "Tabletop.singleton.loadsheets"

Here is my wrapper module/function

var Tabletop = require('tabletop') var tabletop module.exports = function (args, callback) { return function () { tabletop = Tabletop.init({ key: args.key, wanted:[args.sheet], callback:args.callback, prettyColumnNames :false, parseNumbers: false, proxy: (args.isProxy && typeof args.bucket !== 'undefined') ? 'http://'+args.bucket+'.s3.amazonaws.com' : undefined }) } } }

Adding the following line resolves the issue

window.Tabletop = window.Tabletop || Tabletop

tmfrnz avatar Mar 02 '16 06:03 tmfrnz