{"id":20265,"library":"pixi-console","title":"PixiConsole","description":"Pixi-console is a console overlay class for Pixi.js v6/v7 (peer dep) that displays log and error messages on screen, primarily for mobile game debugging. Current stable version is 4.0.0, with support for Pixi v7 added in December 2023. It automatically hooks into console.log and console.error, showing on error, and maintains a singleton pattern. Differentiators: no external dependencies besides Pixi.js, simple API with customizable configuration, and typed via included TypeScript definitions.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/yordan-kanchelov/pixi-console","tags":["javascript","typescript"],"install":[{"cmd":"npm install pixi-console","lang":"bash","label":"npm"},{"cmd":"yarn add pixi-console","lang":"bash","label":"yarn"},{"cmd":"pnpm add pixi-console","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; PixiConsole is a display object that must be added to a Pixi stage.","package":"pixi.js","optional":false}],"imports":[{"note":"ESM-only; package does not provide a CommonJS dist. Use named import.","wrong":"const PixiConsole = require('pixi-console')","symbol":"PixiConsole","correct":"import { PixiConsole } from 'pixi-console'"},{"note":"Named export, not default.","wrong":"import PixiConsoleConfig from 'pixi-console'","symbol":"PixiConsoleConfig","correct":"import { PixiConsoleConfig } from 'pixi-console'"},{"note":"PixiConsole is a singleton; use getInstance() to access the existing instance or create first via new. Constructing again throws.","wrong":"import PixiConsole from 'pixi-console'; const instance = new PixiConsole();","symbol":"PixiConsole.getInstance","correct":"import { PixiConsole } from 'pixi-console'; const instance = PixiConsole.getInstance();"}],"quickstart":{"code":"import { PixiConsole, PixiConsoleConfig } from 'pixi-console';\nimport * as PIXI from 'pixi.js';\n\n// Create a Pixi application\nconst app = new PIXI.Application({ width: 800, height: 600 });\ndocument.body.appendChild(app.view);\n\n// Configure console\nconst config = new PixiConsoleConfig();\nconfig.consoleWidth = 400;\nconfig.consoleHeight = 300;\nconfig.fontSize = 14;\n\n// Create and add to stage\nconst console = new PixiConsole(config);\napp.stage.addChild(console);\n\n// Now console.log and console.error will show on screen\nglobalThis.__PIXI_APP__ = app;\nconsole.log('Debug message');\nconsole.error('Error message');","lang":"typescript","description":"Shows how to import, configure, and attach PixiConsole to a Pixi app stage. Also demonstrates automatic log/error interception."},"warnings":[{"fix":"Use PixiConsole.getInstance() to get the existing instance, or ensure constructor is called only once.","message":"PixiConsole is a singleton; calling new PixiConsole() more than once throws an error.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use pixi-console v3.0.0 for Pixi v5, v2.5.0 for Pixi v4.","message":"Peer dependency requires Pixi.js v6 or v7. Not compatible with Pixi v5 or v4 in v4.0.0.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure import { PixiConsoleConfig } from 'pixi-console'.","message":"PixiConsoleConfig has no named exports; must be imported via named import. No deprecation but may cause confusion.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use ESM import syntax in Node.js or bundler with ES module resolution.","message":"Package does not provide a CommonJS entry; require() will fail. Only ESM import works.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use 'import { PixiConsole } from \"pixi-console\";' or use dynamic import().","cause":"Using require() instead of import; package is ESM-only.","error":"TypeError: PixiConsole is not a constructor"},{"fix":"Use PixiConsole.getInstance() to get the existing instance.","cause":"Attempting to create more than one instance via 'new PixiConsole()'.","error":"Error: PixiConsole is singleton.."},{"fix":"Run 'npm install pixi.js pixi-console'.","cause":"Missing peer dependency pixi.js or PixiConsoleConfig not installed correctly.","error":"Module not found: Can't resolve 'pixi-console'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}