Unable to auto-detect a suitable renderer.
See original GitHub issueExpected 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:
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:
- Created 10 months ago
- Comments:8 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.