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.

InteractionManager cannot read properties - PointerOverOut TreeSearch

See original GitHub issue

@davidfig David, hi - when I add Pixi Viewport to latest Pixi, mouse wheel zoom works but mouseover / scroll pan errors:

InteractionManager.ts:1723 Uncaught TypeError: Cannot read properties of undefined (reading ‘1’) at InteractionManager.processPointerOverOut (InteractionManager.ts:1723:1) at TreeSearch.recursiveFindHit (TreeSearch.ts:173:1) at TreeSearch.recursiveFindHit (TreeSearch.ts:113:1) at TreeSearch.findHit (TreeSearch.ts:200:1) at InteractionManager.processInteractive (InteractionManager.ts:1256:1) at InteractionManager.update (InteractionManager.ts:1090:1) at InteractionManager.tickerUpdate (InteractionManager.ts:1049:1) at TickerListener.emit (TickerListener.ts:68:1) at Ticker.update (Ticker.ts:444:1) at Ticker._tick (Ticker.ts:129:1)

pixi-interaction

    "pixi.js": "^6.2.2",
    "pixi-viewport": "^4.34.4"

Implemented as:

    this.app = new Application({
      antialias: true,
      backgroundColor: 0x0,
      resolution: devicePixelRatio,
      width: 400,
      height: 400,
    });

    this.viewport = new Viewport({
      worldWidth: 400,
      worldHeight: 400,
      screenWidth: window.innerWidth,
      screenHeight: window.innerHeight,
      divWheel: this.app.view,
      interaction: this.app.renderer.plugins.interaction,
    })
      .drag()
      .pinch({ percent: 2 })
      .wheel()
      .decelerate();

    this.app.stage.addChild(this.viewport);
    this.app.ticker.start();

For testing, I added a const g = new PIXI.Graphics() with some line drawing and this.viewport.addChild(g).

Any new conflicts between versions?

Is the interaction manager still the same from the app renderer plugins?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonsturgescommented, Feb 8, 2022

@peili It occurred with a TypeScript npm package of mine that’s using PIxi.js v6.2.2 with the isolated code above, then adding a PIXI.Graphics instance for testing.

If I move that code to an app, I can’t reproduce it - everything works fine.

I think Pixi’s TreeSearch has undergone some development recently - I initially thought it was a Pixi.js problem; however, there are no errors when I remove Pixi Viewport, which led me here.

Sorry that’s not of more help - I can’t seem to isolate an app that reproduces the issue, but I might have more insight in the near future.

0reactions
jasonsturgescommented, Apr 26, 2022

@peili I matched Pixi.js version to Pixi Viewport version in package.json

Not entirely sure it related to Pixi Viewport, as I had another dependency with mismatched versions.

Also, I believe there is an error in Pixi regarding TreeSearch - not sure if it’s related or not: https://github.com/pixijs/pixijs/issues/8179

Read more comments on GitHub >

github_iconTop Results From Across the Web

TreeSearch findHit void function return value used ... - GitHub
In InteractionManager function processInteractive(), ... InteractionManager cannot read properties - PointerOverOut TreeSearch ...
Read more >
uncaught typeerror: cannot read properties of undefined ...
The solution to TypeError: Cannot read properties of undefined Always conditionally check for the variable that is undefined before accessing the value.
Read more >
Interaction Manager's - PixiJS API Documentation
* The interaction manager deals with mouse, touch and pointer events. *; * Any DisplayObject can be interactive if its `interactive` property is ......
Read more >
https://fgregor.com/js/pixi-5.3.3.min.js.map
n * An `Events` instance is a plain object whose properties are event names. ... looped through the whole remaining polygon and can't...
Read more >
Download Diff File - Gitea: IWM Git Webservice
InteractionManager} to automatically give all DisplayObjects these properties + ... The method stops if resource doesn't want this texture to be destroyed.
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