Skip to content

Uncaught TypeError, fresh install, parse 1.6.9 #19

@joaomarceloods

Description

@joaomarceloods

Has anyone gone through this? Is there a fix?

I just installed parse-angular-patch from bower. I get the following error in the browser console as soon is the page is loaded:

Uncaught TypeError: Cannot read property 'prototype' of undefined`
    (anonymous function)    @   parse-angular.js:66
    (anonymous function)    @   parse-angular.js:64

I believe that 'prototype' of undefined refers to Parse[currentClass].prototype[method]:

currentProtoMethods.forEach(function(method) { << LINE 64

    var origMethod = Parse[currentClass].prototype[method]; << LINE 66

    // Overwrite original function by wrapping it with $q
    Parse[currentClass].prototype[method] = function() {

        return origMethod.apply(this, arguments)
            .then(function(data) {
                var defer = $q.defer();
                defer.resolve(data);
                return defer.promise;
            }, function(err) {
                var defer = $q.defer();
                defer.reject(err);
                return defer.promise;
            });

    };

});

I used src version of parse-angular-patch to get the line number for the error, but it happens on dist version too. This is my configuration... This is also the order that I am importing the scripts in HTML:

parse 1.6.9
angular 1.4.8
parse-angular-patch 0.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions