Quick answer: RPG Maker MV and MZ do not write a crash log, so you have to capture errors yourself. Write a plugin that aliases SceneManager.catchException (every error thrown inside the game loop ends up there on both engines), adds window listeners for error and unhandledrejection, and posts each distinct error once with fetch. For player-written reports, show a DOM <textarea> above the canvas and stop its key events from reaching the engine.
An RPG Maker crash is a black screen with one red line: TypeError: Cannot read property 'width' of undefined. In a playtest you press F8, read the stack in the console and find the plugin responsible. In a deployed game the player has no console, nothing is written to disk, and what reaches you is “it crashed in the second town”. This guide builds one plugin, BugnetReport.js, that works on MZ and MV: it reports crashes automatically with the stack trace and the map ID, and gives players a form to describe everything that is not a crash.
- Where RPG Maker errors go: there is no crash log
- The plugin, part 1: parameters and sending
- Part 2: catching crashes once each
- Part 3: a bug report form players can type in
- Install it and test in a deployed build
- What the reports usually turn out to be
- Where the reports land
- Related guides
- Frequently asked questions
Where RPG Maker errors go: there is no crash log
People search for the RPG Maker MZ crash log or the MV error log expecting a file. There is not one. When something throws, the engine stops the game loop, stops the audio and prints the error name and message over the canvas. The full stack goes to the developer console, which you can open with F8 during a playtest. A normal deployment has no developer tools, so that stack is gone the moment the player closes the window.
Three kinds of failure matter, and they travel different routes:
- Errors inside the game loop. Scene updates, event script calls, battle code and almost all plugin code run inside
SceneManager’s update, which wraps everything in a try/catch and passes the error toSceneManager.catchException(e). Because they are caught, these never reachwindow.onerror. - Errors outside the loop. Timers, DOM event handlers and code that runs while scripts load are not inside that try/catch. They surface as a
windowerrorevent, and rejected promises asunhandledrejection. - Assets that fail to load. In MZ a missing image reaches
catchExceptionas an array,["LoadError", url, retry], not anErrorobject. MV shows failed loads on a separate retry screen.
A plugin that covers all three needs one alias and two listeners.
The plugin, part 1: parameters and sending
Save the following as js/plugins/BugnetReport.js. The file name matters, because PluginManager.parameters looks parameters up by it. MZ reads every annotation in the header; MV ignores the ones it does not know. The example sends to Bugnet’s report endpoint, but the structure is the same for any JSON API.
/*:
* @target MZ
* @plugindesc Sends crashes and player bug reports to your bug tracker.
* @author Your Studio
*
* @param apiKey
* @text API key
* @type string
* @default
*
* @param gameVersion
* @text Game version
* @type string
* @default 1.0.0
*
* @param reportKey
* @text Report key
* @desc Key that opens the report form. Use a KeyboardEvent.key name.
* @type string
* @default F6
*
* @command openReport
* @text Open bug report form
* @desc Shows the bug report form on top of the game.
*
* @help Save as js/plugins/BugnetReport.js and enable it in the Plugin Manager.
* MV plugin command: BugnetReport
* Script call: BugnetReport.open()
*/
(() => {
"use strict";
const PLUGIN_NAME = "BugnetReport";
const ENDPOINT = "https://api.bugnet.io/api/bugs/submit";
const params = PluginManager.parameters(PLUGIN_NAME);
const API_KEY = String(params.apiKey || "").trim();
const GAME_VERSION = String(params.gameVersion || "unknown");
const REPORT_KEY = String(params.reportKey || "F6");
const MAX_AUTO_REPORTS = 5;
const sentTitles = new Set();
let form = null;
function platformName() {
if (Utils.isNwjs()) {
const p = process.platform;
return p === "win32" ? "Windows" : p === "darwin" ? "macOS" : "Linux";
}
return Utils.isMobileDevice() ? "Mobile browser" : "Web";
}
function gameContext() {
const info = {
engine: "RPG Maker " + Utils.RPGMAKER_NAME + " " + Utils.RPGMAKER_VERSION,
scene: SceneManager._scene ? SceneManager._scene.constructor.name : "none"
};
if (typeof $dataSystem !== "undefined" && $dataSystem) {
info.gameTitle = $dataSystem.gameTitle;
}
if (typeof $gameMap !== "undefined" && $gameMap) {
info.mapId = $gameMap.mapId();
}
if (typeof $gamePlayer !== "undefined" && $gamePlayer) {
info.playerX = $gamePlayer.x;
info.playerY = $gamePlayer.y;
}
return info;
}
function send(report) {
if (!API_KEY) {
return Promise.resolve(false);
}
let metadata = {};
try {
metadata = gameContext();
} catch (e) {
// Context is a bonus. Never let it block the report.
}
const body = Object.assign({
platform: platformName(),
game_version: GAME_VERSION,
os_info: navigator.userAgent.slice(0, 100),
metadata: metadata
}, report);
return fetch(ENDPOINT, {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-Key": API_KEY },
body: JSON.stringify(body),
keepalive: true
}).then(response => response.ok, () => false);
}
The globals are checked with typeof because a crash can happen on the title screen before $gameMap exists, and reading an undeclared name would throw a second error inside the reporter. The map ID and player position are the two facts players never give you and the first two you need.
The keepalive flag asks the runtime to finish the request even if the player closes the window straight after the crash.
Part 2: catching crashes once each
Continue inside the same function:
function describe(error) {
if (error instanceof Error) {
return { title: error.name + ": " + error.message, detail: error.stack || "" };
}
if (Array.isArray(error) && error[0] === "LoadError") {
return { title: "LoadError: " + error[1], detail: "" };
}
return { title: "Error: " + String(error), detail: "" };
}
function reportError(error, source) {
const info = describe(error);
const title = info.title.slice(0, 200);
if (sentTitles.has(title) || sentTitles.size >= MAX_AUTO_REPORTS) {
return;
}
sentTitles.add(title);
send({
title: title,
description: title + "\nCaught by: " + source + "\n\n" + info.detail,
category: "crash",
priority: "high",
auto_captured: true
});
}
const _catchException = SceneManager.catchException;
SceneManager.catchException = function(e) {
try {
reportError(e, "SceneManager.catchException");
} catch (ignored) {
// Reporting must never hide the original error.
}
_catchException.call(this, e);
};
window.addEventListener("error", event => {
reportError(event.error || event.message, "window error event");
});
window.addEventListener("unhandledrejection", event => {
reportError(event.reason, "unhandled promise rejection");
});
// MV shows failed asset loads on its own retry screen.
if (typeof Graphics.printLoadingError === "function") {
const _printLoadingError = Graphics.printLoadingError;
Graphics.printLoadingError = function(url) {
reportError(["LoadError", url], "Graphics.printLoadingError");
_printLoadingError.call(this, url);
};
}
Three decisions are worth explaining.
Alias, then call the original. The player still sees the normal error screen, and in MZ the Retry button on a load error still works. Your plugin observes the failure; it does not change it.
The title is the error name and message, nothing else. TypeError: Cannot read property 'width' of undefined is identical for every player who hits it. A tracker that groups by title turns two hundred crashes into one report with two hundred occurrences. Put the map ID, the timestamp or the player’s name in the title and you get two hundred separate reports.
Each distinct error is sent once per session, five at most. An error inside a parallel event or a timer can fire again and again. Without the Set you would spend the player’s bandwidth and hit the server’s rate limit within a second.
Part 3: a bug report form players can type in
Most bugs do not throw. A chest that gives the wrong item, an event that will not trigger, a passable wall: the player has to tell you. RPG Maker has no text field, and a name-entry scene is a miserable way to write a sentence, so use the fact that the game is a web page and put a real <textarea> over the canvas.
The catch is the engine’s input code. It listens for key events on document and cancels the default action for the keys it uses, so Backspace, Space and the arrow keys do nothing inside a text box. Stopping the events from propagating out of the form fixes that.
function openForm() {
if (form) {
return;
}
form = document.createElement("div");
form.style.cssText =
"position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;" +
"display:flex;align-items:center;justify-content:center;" +
"background:rgba(0,0,0,0.6);font-family:sans-serif;";
const box = document.createElement("div");
box.style.cssText =
"background:#fff;color:#111;padding:16px;border-radius:8px;" +
"width:420px;max-width:90%;";
const label = document.createElement("div");
label.textContent = "What went wrong? Your note, map and game version " +
"are sent to the developer.";
const text = document.createElement("textarea");
text.rows = 5;
text.maxLength = 1000;
text.style.cssText = "width:100%;box-sizing:border-box;margin:8px 0;font-size:16px;";
const sendButton = document.createElement("button");
sendButton.textContent = "Send";
const cancelButton = document.createElement("button");
cancelButton.textContent = "Cancel";
box.appendChild(label);
box.appendChild(text);
box.appendChild(sendButton);
box.appendChild(cancelButton);
form.appendChild(box);
document.body.appendChild(form);
// Keep key, mouse and touch events away from the engine's document listeners.
["keydown", "keyup", "mousedown", "mouseup", "touchstart", "touchend", "wheel"]
.forEach(type => form.addEventListener(type, e => e.stopPropagation()));
sendButton.addEventListener("click", () => {
const note = text.value.trim();
if (!note) {
return;
}
sendButton.disabled = true;
send({ title: note.slice(0, 80), description: note }).then(ok => {
label.textContent = ok
? "Thanks. Your report was sent."
: "Could not send the report. Check your connection.";
setTimeout(closeForm, 1500);
});
});
cancelButton.addEventListener("click", closeForm);
Input.clear();
TouchInput.clear();
text.focus();
}
function closeForm() {
if (!form) {
return;
}
document.body.removeChild(form);
form = null;
Input.clear();
TouchInput.clear();
}
document.addEventListener("keydown", event => {
if (event.key === REPORT_KEY) {
openForm();
}
});
// MZ plugin command.
if (typeof PluginManager.registerCommand === "function") {
PluginManager.registerCommand(PLUGIN_NAME, "openReport", () => openForm());
}
// MV plugin command: BugnetReport
const _pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
if (typeof _pluginCommand === "function") {
_pluginCommand.call(this, command, args);
}
if (command === PLUGIN_NAME) {
openForm();
}
};
window.BugnetReport = { open: openForm, send: send };
})();
Input.clear() on open is not optional. If the player is holding an arrow key when the form appears, the key-up event lands in the form and never reaches the engine, and the character walks into a wall until the form closes.
The game keeps running behind the form, so offer it where nothing urgent is happening: an NPC in the first town, an item in the menu that runs the plugin command through a common event, or the hotkey. The default is F6 because the engine already uses F2, F3, F4, F5, F8 and F9 for the FPS counter, stretch mode, fullscreen, reload, developer tools and the debug menu.
This version leaves out a screenshot. The engine can snapshot the current scene, but the bitmap API differs between MV and MZ, and the map ID plus player coordinates usually locate the problem on their own.
Install it and test in a deployed build
- Save the file as
js/plugins/BugnetReport.js. - Open the Plugin Manager, add
BugnetReport, set it to ON, and fill in the API key and your game version. - Add a test event with a Script command:
throw new Error("Report test"); - Playtest, trigger the event and confirm one report arrives with the stack, map ID and player position. Trigger it again in the same session and confirm no second report is sent.
- Deploy the game and repeat the test in the deployed build. That is the build players run, and deployment is where missing assets appear.
On MV, use version 1.6 or later. Earlier MV releases ship an older NW.js runtime that predates fetch and arrow functions. Change the game version parameter on every release: a crash report without a version cannot tell you whether the bug is already fixed.
What the reports usually turn out to be
- A plugin conflict. The stack trace lists file names.
js/plugins/SomeBattleHud.jsat the top of the stack tells you which plugin to disable or reorder, which is the question that takes longest by hand. - LoadError for a file that exists. File names are case-sensitive in browsers on a web server, on Linux and on Android, and not on Windows.
Actor1.pngreferenced asactor1.pngworks on your PC and fails for those players. - LoadError only in the deployed build. The “exclude unused files” deployment option cannot see assets that are referenced only from plugin parameters or script calls, and strips them.
- Errors right after loading a save. A save made on an older version is missing data a newer plugin expects. The game version in the report, compared with what the player says they were doing, gives it away.
Where the reports land
The plugin posts to Bugnet’s public report API. RPG Maker has no dedicated Bugnet SDK and does not need one: the endpoint takes a JSON body and the project’s API key in X-API-Key. That key is an ingestion key, safe to ship in a plugin file, because it can file reports but cannot read them. The endpoint accepts browser requests from any origin, so browser and wrapped mobile deployments work without extra setup.
In the dashboard, identical crash titles stack into one report with an occurrence count, each carrying its own platform, version and metadata, so the worst crash sorts to the top. Player-written reports arrive alongside them with the map and coordinates attached. From there you can assign and prioritize, post new reports to Discord, and publish a public tracker so players can see a bug is known before they report it again. The free plan covers one project and up to 100 bug reports. The quickstart shows where the API key is.
Related guides
- A Bug Report API for Games: Submit Reports from Launchers, Servers and Tools
- window.onerror vs unhandledrejection: Catching Every JavaScript Error in an HTML5 Game
- How to Fix “Uncaught TypeError: Cannot read properties of undefined” in a Web Game
- Bug Tracking for JRPGs
- How to Prevent Duplicate Bug Reports
Frequently asked questions
Where is the crash log for an RPG Maker MV or MZ game?
There is none. RPG Maker MV and MZ print the error on screen and to the developer console, and nothing is written to disk. A deployed game has no console for the player to open, so the only record is what the player remembers unless a plugin sends or saves the error.
How do I catch errors in an RPG Maker MZ plugin?
Alias SceneManager.catchException, which receives every error thrown inside the game loop, and add window listeners for the error and unhandledrejection events to cover code that runs outside the loop. Always call the original catchException so the normal error screen still appears.
Does one error reporting plugin work in both RPG Maker MV and MZ?
Mostly, yes. SceneManager.catchException, PluginManager.parameters, Utils and fetch exist on both. Plugin commands are registered differently, so a plugin that supports both needs PluginManager.registerCommand for MZ and a Game_Interpreter.pluginCommand alias for MV, and MV should be version 1.6 or later.
Why can players not type in a text box in my RPG Maker game?
The engine listens for key presses on the document and cancels the default action for keys it uses, such as Backspace, Space and the arrow keys. Stop the keydown event from propagating out of your text box and the keys behave normally again.
Does crash reporting work in RPG Maker web and mobile deployments?
Yes, as long as the plugin sends with fetch and the server accepts cross-origin requests. Bugnet’s report endpoint accepts browser requests from any origin, so the same plugin works in desktop, browser and wrapped mobile builds.
A deployed RPG Maker game keeps no record of its own errors. One plugin that reports each distinct crash once is the difference between a vague forum post and a stack trace naming the plugin at fault.