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.

Unable to auto-detect a suitable renderer.

See original GitHub issue

Expected Behavior

Not to bug

Current Behavior

The PIXI app bugs in a hard to describe way, quite choatically and randomly. Here is a video to show the bug:

https://user-images.githubusercontent.com/33256529/202049293-492caef5-3c79-4d8b-8ff1-9a7767fd8afd.mp4

The navigator shakes chaotically and when I refresh the page, I get a white page with the following error in the console:

Uncaught Error: Unable to auto-detect a suitable renderer.
    at autoDetectRenderer (autoDetectRenderer.ts:67:1)
    at new _Application (Application.ts:107:1)
    at new Game (Game.js:11:1)
    at ./src/game/Game.js (Game.js:97:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./src/components/Game.js (App.js:11:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)

It seems to appear when I save my changes, after an extended period of staying in my IDE. Also, it disappears after some time, and the app works again, until it breaks yet another time.

Possible Solution

🤷‍♂️

Steps to Reproduce

I can give the source code of my project privately if needed.

Environment

  • pixi.js version: 7.0.4
  • Browser & Version: Chrome 107.0.5304.110
  • OS & Version: MacOS Monterey 12.4
  • Running Example: N/A

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bigtimebuddycommented, Nov 19, 2022

You are creating a new Graphics for every frame @ 60fps (ticker.add => new PIXI.Graphics). This is allocating memory for every Graphic instance, which, overtime can add up! The crash you are experiencing is likely because of memory running out.

This is not a bug. This is a memory leak. It is important, like anything JavaScript to be mindful of new objects you are creating.

0reactions
PierreTurnbullcommented, Nov 19, 2022

Oh that’s right, it works fine now. I could have found the solution in the guide or API doc about Graphics. I thought the problem was about the Texts, which do not need explicit destruction. Thanks for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Could not auto-detect a React renderer." when bundled with ...
Successfully merging a pull request may close this issue. fix: improve error message when auto-detection fails to mention bundlers testing- ...
Read more >
Choosing renderer with better performance - Pixi.js
Which do you use: autoDetectRenderer with or without forceCanvas as default and option to opt WebGL rendering?
Read more >
PIXI.autoDetectRenderer
Name Type Default options object options.width number 800 options.height number 600
Read more >
Displaying figures in Python - Plotly
This is because plotly.py attempts to autodetect an appropriate renderer at startup. You can change the default renderer by assigning the name of...
Read more >
PIXI.settings - PixiJS API Documentation
This is a much better strategy than trying to create a PixiJS renderer and finding it then fails. Default Value: false. PIXI.settings.FILTER_MULTISAMPLE PIXI....
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