{"action":"created","issue":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/145","repository_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files","labels_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/145/comments","events_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/145/events","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/145","id":165352069,"number":145,"title":"TypeError: object is not a Function","user":{"login":"sethmurphy18","id":3085408,"avatar_url":"https://avatars.githubusercontent.com/u/3085408?v=3","gravatar_id":"","url":"https://api.github.com/users/sethmurphy18","html_url":"https://github.com/sethmurphy18","followers_url":"https://api.github.com/users/sethmurphy18/followers","following_url":"https://api.github.com/users/sethmurphy18/following{/other_user}","gists_url":"https://api.github.com/users/sethmurphy18/gists{/gist_id}","starred_url":"https://api.github.com/users/sethmurphy18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethmurphy18/subscriptions","organizations_url":"https://api.github.com/users/sethmurphy18/orgs","repos_url":"https://api.github.com/users/sethmurphy18/repos","events_url":"https://api.github.com/users/sethmurphy18/events{/privacy}","received_events_url":"https://api.github.com/users/sethmurphy18/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/help%20wanted","name":"help wanted","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-07-13T15:35:19Z","updated_at":"2016-07-13T18:58:22Z","closed_at":null,"body":"Ok, so for some reason, I am getting an error related to the constructor. I wish I had more debug info, sadly I don't because my app won't even launch...it just keeps crashing on boot.\r\n\r\n```sh\r\n=> Started proxy.\r\n=> Started MongoDB.\r\nW20160713-11:17:20.286(-4)? (STDERR)\r\nW20160713-11:17:21.714(-4)? (STDERR) C:\\Users\\Seth\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.3.4_4\\mt-os.windows.x86_32\\dev_bundle\\server-lib\\node_modules\\fibers\\future.js:280\r\nW20160713-11:17:21.718(-4)? (STDERR)                                            throw(ex);\r\nW20160713-11:17:21.725(-4)? (STDERR)                                                  ^\r\nW20160713-11:17:21.728(-4)? (STDERR) TypeError: object is not a function\r\nW20160713-11:17:21.730(-4)? (STDERR)     at meteorInstall.server.collections.ProfilePictures.js (server/collections/ProfilePictures.js:43:23)\r\nW20160713-11:17:21.733(-4)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)\r\nW20160713-11:17:22.077(-4)? (STDERR)     at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)\r\nW20160713-11:17:22.088(-4)? (STDERR)     at C:\\Users\\Seth\\Projects\\Website\\.meteor\\local\\build\\programs\\server\\app\\app.js:218:1\r\nW20160713-11:17:22.093(-4)? (STDERR)     at C:\\Users\\Seth\\Projects\\Website\\.meteor\\local\\build\\programs\\server\\boot.js:297:10\r\nW20160713-11:17:22.100(-4)? (STDERR)     at Array.forEach (native)\r\nW20160713-11:17:22.108(-4)? (STDERR)     at Function._.each._.forEach (C:\\Users\\Seth\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.3.4_4\\mt-os.windows.x86_32\\dev_bundle\\server-lib\\node_modules\\underscore\\underscore.js:79:11)\r\nW20160713-11:17:22.110(-4)? (STDERR)     at C:\\Users\\Seth\\Projects\\Website\\.meteor\\local\\build\\programs\\server\\boot.js:133:5\r\n=> Exited with code: 8\r\n```\r\n\r\nAs for my source code, I have double and triple checked that I am typing everything correctly, I just cannot figure out where the issue is.\r\n\r\n```javascript\r\nimport { EJSON } from 'meteor/ejson';\r\nimport { Meteor } from 'meteor/meteor';\r\nimport { Random } from 'meteor/random';\r\nimport { _ } from 'meteor/underscore';\r\nimport gcloud from 'google-cloud-storage-standalone';\r\nimport FilesCollection from 'meteor/ostrio:files';\r\nimport SimpleSchema from 'meteor/aldeed:simple-schema';\r\n\r\nvar googleCloudStorage, bucket, bucketInfo, bound, ProfilePictures = {};\r\n\r\nlet googleCloudCredentials = EJSON.parse(Assets.getText('google-cloud-account.json'));\r\n\r\n// Intialize Google Cloud Storage\r\ngoogleCloudStorage = gcloud.storage({\r\n  projectId: 'com-eagerestwolf-website-2',\r\n  config: {\r\n    credentials: {\r\n      client_email: googleCloudCredentials.client_email,\r\n      private_key: googleCloudCredentials.private_key\r\n    }\r\n  }\r\n});\r\n\r\n// Set which bucket to use\r\nbucket = googleCloudStorage.bucket('com-eagerestwolf-website-storage-1');\r\n\r\n// Get the bucket information so we have the URL\r\nbucket.getMetadata(function(error, metadata, apiResponse) {\r\n  \"use strict\";\r\n  if (error) {\r\n    console.error(error);\r\n  } else {\r\n    bucketInfo = metadata;\r\n  }\r\n});\r\n\r\nbound = Meteor.bindEnvironment(function(callback) {\r\n  \"use strict\";\r\n  return callback();\r\n});\r\n\r\nProfilePictures = new FilesCollection({\r\n  debug: false,\r\n  throttle: false,\r\n  storagePath: 'assets/app/uploads/profile_pictures',\r\n  collectionName: 'profile-pictures',\r\n  allowClientCode: false,\r\n  \r\n  onbeforeunloadMessage: function () {\r\n    \"use strict\";\r\n    return 'Upload is still in progress! Upload will be aborted if you leave this page!';\r\n  },\r\n\r\n  onBeforeUpload: function (file) {\r\n    \"use strict\";\r\n    if (file.size <= 31457280 && /png|jpg|jpeg/i.test(file.ext)) {\r\n      return true;\r\n    } else {\r\n      return 'Please upload a png or jpeg image, with size equal or less than 30MB';\r\n    }\r\n  },\r\n\r\n  onAfterUpload: function(fileRef) {\r\n    \"use strict\";\r\n    var self = this;\r\n    _.each(fileRef.versions, function(vRef) {\r\n      var filePath = \"images/profile_pictures/\" + (Random.id()) + \".\" + fileRef.extension;\r\n      \r\n      var options = {\r\n        destination: filePath\r\n      };\r\n\r\n      bucket.upload(fileRef.path, options, function(error, file) {\r\n        var upd;\r\n        if (error) {\r\n          console.error(error);\r\n        } else {\r\n          upd = {\r\n            $set: {}\r\n          };\r\n          upd['$set'][\"meta.pipeFrom\"] = bucketInfo.selfLink + '/' + filePath;\r\n          upd['$set'][\"meta.pipePath\"] = filePath;\r\n          self.collection.update({\r\n            _id: fileRef._id\r\n          }, upd, function (error) {\r\n            if (error) {\r\n              console.error(error);\r\n            } else {\r\n              self.unlink(self.collection.findOne(fileRef._id), fileRef.version);\r\n            }\r\n          });\r\n        }\r\n      });\r\n    });\r\n  }\r\n});\r\n\r\nProfilePictures.collection.attachSchema(new SimpleSchema(ProfilePictures.schema));\r\n\r\n// Intercept file's collection remove method to remove file from Google Cloud Storage\r\nvar _origRemove = ProfilePictures.remove;\r\n\r\nProfilePictures.remove = function(search) {\r\n  \"use strict\";\r\n  var cursor = this.collection.find(search);\r\n  cursor.forEach(function(fileRef) {\r\n    _.each(fileRef.versions, function(vRef) {\r\n      var ref;\r\n      if (vRef !== null ? (ref = vRef.meta) !== null ? ref.pipePath : void 0 : void 0) {\r\n        bucket.deleteFiles(vRef.meta.pipePath, function(error) {\r\n          bound(function() {\r\n            if (error) {\r\n              console.error(error);\r\n            }\r\n          });\r\n        });\r\n      }\r\n    });\r\n  });\r\n  // Call the original removal method\r\n  _origRemove.call(this, search);\r\n};\r\n\r\nProfilePictures.deny({\r\n  insert: function() {\r\n    \"use strict\";\r\n    return true;\r\n  },\r\n  update: function() {\r\n    \"use strict\";\r\n    return true;\r\n  },\r\n  remove: function() {\r\n    \"use strict\";\r\n    return true;\r\n  }\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/comments/232453129","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/145#issuecomment-232453129","issue_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/145","id":232453129,"user":{"login":"sethmurphy18","id":3085408,"avatar_url":"https://avatars.githubusercontent.com/u/3085408?v=3","gravatar_id":"","url":"https://api.github.com/users/sethmurphy18","html_url":"https://github.com/sethmurphy18","followers_url":"https://api.github.com/users/sethmurphy18/followers","following_url":"https://api.github.com/users/sethmurphy18/following{/other_user}","gists_url":"https://api.github.com/users/sethmurphy18/gists{/gist_id}","starred_url":"https://api.github.com/users/sethmurphy18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethmurphy18/subscriptions","organizations_url":"https://api.github.com/users/sethmurphy18/orgs","repos_url":"https://api.github.com/users/sethmurphy18/repos","events_url":"https://api.github.com/users/sethmurphy18/events{/privacy}","received_events_url":"https://api.github.com/users/sethmurphy18/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T18:58:22Z","updated_at":"2016-07-13T18:58:22Z","body":"I'm exporting the CoffeeScript to Javascript, then I will give you an idea what I mean"}}
{"actor":{"display_login":"sethmurphy18"}}