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.

Error: Cannot read property 'mouse' of undefined

See original GitHub issue

Using angular@2.3.1 and angular2-tree-component@2.7.0, trying the minimalist example shown in the Basic usage section of https://angular2-tree.readme.io/docs, when selecting any node of the tree, I get the following error in Chrome console: EXCEPTION: Error in ./TreeNodeComponent class TreeNodeComponent - inline template:15:10 caused by: Cannot read property 'mouse' of undefined I tried this in a vanilla installation with angular-cli@1.0.0-beta.26, just added angular2-tree-component to the skeleton. The same works fine with angular-cli@1.0.0-beta.21, which installs angular@2.2.1

Further message in the console:

TypeError: Cannot read property 'mouse' of undefined
    at TreeNode.mouseAction (tree-node.model.js:323)
    at View_TreeNodeComponent1.handleEvent_8 (component.ngfactory.js:305)
    at View_TreeNodeComponent1.<anonymous> (view.js:664)
    at HTMLDivElement.<anonymous> (dom_renderer.js:490)
    at ZoneDelegate.invokeTask (zone.js:275)
    at Object.onInvokeTask (ng_zone.js:262)
    at ZoneDelegate.invokeTask (zone.js:274)
    at Zone.runTask (zone.js:151)
    at HTMLDivElement.ZoneTask.invoke (zone.js:345)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
girokoncommented, Feb 17, 2017

@szepeshazi I mean this:

const actionMapping: IActionMapping = {
    mouse: {
        click: TREE_ACTIONS.TOGGLE_SELECTED,
        dblClick: null,
        contextMenu: null,
        expanderClick: TREE_ACTIONS.TOGGLE_EXPANDED,
        drop: TREE_ACTIONS.MOVE_NODE
    },
    keys: {
        [KEYS.RIGHT]: TREE_ACTIONS.DRILL_DOWN,
        [KEYS.LEFT]: TREE_ACTIONS.DRILL_UP,
        [KEYS.DOWN]: TREE_ACTIONS.NEXT_NODE,
        [KEYS.UP]: TREE_ACTIONS.PREVIOUS_NODE,
        [KEYS.SPACE]: TREE_ACTIONS.TOGGLE_SELECTED,
        [KEYS.ENTER]: TREE_ACTIONS.TOGGLE_SELECTED
    }
};

class MyComponent {

     private treeOptions = {
        actionMapping
    };
}


// in the template:

<Tree [nodes]="nodes" [options]="treeOptions" />

I just copy-paste it from https://angular2-tree.readme.io/docs/action-mapping#default-mapping

0reactions
adamkleingitcommented, Feb 22, 2017

@szepeshazi @girokon I can’t reproduce, can you send webpackbin / link to repo?

I’m closing the issue in the meantime

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'mouse') #2023
Hi everyone, I use jquery-ui: 1.13.0 in particullary widget draggable.js, in Angular 12. Bu when I refresh the page I get this error:...
Read more >
Uncaught TypeError: Cannot read property 'mouse' of undefined
Appearance > Widgets: it is not possible to add new widgets. In inspector chrome: Uncaught TypeError: Cannot read property 'mouse' of undefined
Read more >
jQuery.ui undefined after requirejs optimization - Stack Overflow
This happens on a line trying to access jQuery.ui.mouse . Inside the browser console, jQuery is correctly set in the window context, but...
Read more >
uncaught typeerror: cannot read properties of ... - You.com
In your example Uncaught TypeError: Cannot read properties of undefined (reading 'replace' ) can occur only if your variables song and/or artist are...
Read more >
Uncaught TypeError: Cannot read ... - DevExpress Support
Uncaught TypeError : Cannot read properties of undefined (reading 'column') · Render your custom component outside DataGrid and see if the issue ...
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