question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'deep' of undefined

See original GitHub issue

With webpack, doing :

npm install jointjs require("jointjs")

it gives the following error :

Cannot read property 'deep' of undefined

Here is the full stacktrace :

(anonymous function)    @   joint.js:2800
(anonymous function)    @   lodash.js:4411
baseForOwn  @   lodash.js:2654
(anonymous function)    @   lodash.js:4380
forEach @   lodash.js:8634
mixin   @   joint.js:2798
deepSupplement  @   joint.js:2852
(anonymous function)    @   joint.js:10197
(anonymous function)    @   joint.js:18
g   @   joint.js:19
(anonymous function)    @   joint.js:44
__webpack_require__ @   bootstrap d4f91c7…:555
fn  @   bootstrap d4f91c7…:86
(anonymous function)    @   topology_builder_jointjs.js:1
__webpack_require__ @   bootstrap d4f91c7…:555
fn  @   bootstrap d4f91c7…:86
(anonymous function)    @   init.js:52
__webpack_require__ @   bootstrap d4f91c7…:555
fn  @   bootstrap d4f91c7…:86
(anonymous function)    @   index.js:1
__webpack_require__ @   bootstrap d4f91c7…:555
fn  @   bootstrap d4f91c7…:86
(anonymous function)    @   bootstrap d4f91c7…:578
__webpack_require__ @   bootstrap d4f91c7…:555
(anonymous function)    @   bootstrap d4f91c7…:578
(anonymous function)    @   bootstrap d4f91c7…:578

The part of the corresponding code in joint.js is :

        mixin: function() {

            var target = arguments[0];

            for (var i = 1, l = arguments.length; i < l; i++) {

                var extension = arguments[i];

                // Only functions and objects can be mixined.

                if ((Object(extension) !== extension) &&
                    !_.isFunction(extension) &&
                    (extension === null || extension === undefined)) {

                    continue;
                }

                _.each(extension, function(copy, key) {

                    if (this.mixin.deep && (Object(copy) === copy)) {

                        if (!target[key]) {

                            target[key] = _.isArray(copy) ? [] : {};
                        }

                        this.mixin(target[key], copy);
                        return;
                    }

Any idea ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bcarson1commented, Jul 2, 2016

Had the same problem. Its probably a Lodash version problem, I just switched from 4.13.1 to 3.10.1 and it worked.

1reaction
sbowlercommented, Aug 17, 2016

We have also been stuck using 3.10 because of this dependency. It would be great to remove it or bundle it so there’s not version conflicts like this. IMO, there should probably be a new issue created to do one or the other so people interested can follow what is happening regarding it.

Or would you guys be open to a pull request updating everything to lodash 4.x?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest with vue3 typescript TypeError: Cannot read property ...
I had the same problem with the error TypeError: Cannot read property 'deep' of undefined . This was caused by the usage of...
Read more >
Error in render: “TypeError: Cannot read property 'name' of ...
I get the error in title if I go to deep in the object. ... in render: “TypeError: Cannot read property 'name' of...
Read more >
[2022]TypeError: Cannot read properties of undefined ...
[2022]TypeError: Cannot read properties of undefined (reading 'deep') - Vue · “The code was working a moment ago, but it's not working now.”....
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
vue3 报错Cannot read property 'deep' of undefined at ...
报错信息runtime-core.esm-bundler.js:3320 Uncaught (in promise) TypeError: Cannot read property 'deep' of undefined at withDirectives ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found