Skip to content

TypeError: Cannot read property 'ownerDocument' of undefined #114

@bitflower

Description

@bitflower

Hi,

I'm running the form builder since 2014 in a project of a customer.

We now have updated Angular to 1.6.5 (from 1.5.9), Bootstrap to 3.3.7 (from 3.3.6) and jQuery from 2.2.4 to 3.1.1 (from 2.2.4).

After these updates we get the error mentioned.

I have done some investigations and found out that there is a connection to jQuery and Sizzle.js. In the .contains() method the ownerDocument is not set. In a long chain of calls the initial call that is causing the problem is the last line in the below block - return $(element).html(view);:

.directive('fbComponent', [ '$injector', function($injector) { var $builder, $compile, $drag; $builder = $injector.get('$builder'); $drag = $injector.get('$drag'); $compile = $injector.get('$compile'); return { restrict: 'A', scope: { component: '=fbComponent' }, controller: 'fbComponentController', link: function(scope, element) { scope.copyObjectToScope(scope.component); $drag.draggable($(element), { mode: 'mirror', defer: false, object: { componentName: scope.component.name } }); return scope.$watch('component.template', function(template) { var view; if (!template) { return; } view = $compile(template)(scope); return $(element).html(view); }); } };

What I find strange is that view object is handed over to html() instead of just the html-content (The view object contains way more properties and is not just a string of html).

I have the feeling that this is somehow related to the jQuery / jQLite update to version 3 which came with Angular 1.6.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions