Using Parse.com Javascript library from Firefox add-on

19 views
Skip to first unread message

Anando

unread,
Feb 18, 2016, 2:39:26 PM2/18/16
to mozilla-labs-jetpack
Hi,
These are the steps I followed from https://parse.com/apps/quickstart#parse_data/web/new

- In my add-on root: npm install parse --save
- Added some test code 

var Parse = require('parse');

Parse.initialize("hidden", "hidden");

var TestObject = Parse.Object.extend("TestObject");

var testObject = new TestObject();

testObject.save({foo: "bar"}).then(function(object) {

  alert("yay! it worked");

});


- On jpm run, I get this error:


JPM [info] Starting jpm run on PrivyAddon

JPM [info] Creating a new profile

console.error: privy-addon: 

JPM [error]   Message: TypeError: require(...).Object is undefined

  Stack:

@resource://privy-addon/node_modules/core-js/library/fn/object/keys.js:2:18

@resource://privy-addon/node_modules/babel-runtime/core-js/object/keys.js:1:31

@resource://privy-addon/node_modules/parse/lib/browser/ParseACL.js:18:20

@resource://privy-addon/node_modules/parse/lib/browser/decode.js:21:17

@resource://privy-addon/node_modules/parse/lib/browser/Parse.js:16:15

@resource://privy-addon/node_modules/parse/index.js:1:18

@resource://privy-addon/index.js:13:13

run@resource://gre/modules/commonjs/sdk/addon/runner.js:147:19

startup/</<@resource://gre/modules/commonjs/sdk/addon/runner.js:87:9

Handler.prototype.process@resource://gre/modules/Promise-backend.js:934:23

this.PromiseWalker.walkerLoop@resource://gre/modules/Promise-backend.js:813:7

this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise-backend.js:747:1


- keys.js has:

require('../../modules/es6.object.keys');

module.exports = require('../../modules/$.core').Object.keys;

Reply all
Reply to author
Forward
0 new messages