Batch HTML Export Crashes InDesign 21.1
Here is a (Gemini 3-assisted) report of an HTML export problem that is crashing InDesign consistently. It's somewhat urgent because crashing InDesign is not good for the nerves. Reverting to 21.0.1 permits the script to run to completion.
Bug Report: Regression in HTML Export Automation (dvacore::xml / AXE8)
Subject: InDesign 21.1 (and Prerelease) crashes with EXCEPTIONACCESSVIOLATION in dvacore::xml during iterative HTML Export scripting.
Summary: Automated workflows that iterate through documents to export HTML (ExportFormat.HTML) fail consistently after processing 2–5 files. The crash occurs during the document closure or immediate post-processing phase of the export. This is a regression. The identical script logic functioning on the same hardware/OS was stable in previous InDesign builds (v21.0) but now crashes 100% of the time in v21.1.0.56.
Environment:
Application: InDesign 2026 (21.1.0.56) & Prerelease (21.2) Build
OS: Windows 11 Pro (Build 26200)
Hardware: Intel Core i7-12700K, NVIDIA GeForce RTX 3090 (Driver 32.0.15.8157)
RAM: 64GB
Crash Signature: The crash consistently occurs in the dvacore module, specifically involving the Expat XML parser used during HTML generation.
• Exception: 0xc0000005 (ACCESSVIOLATION)
• Faulting Module: dvacore.dll
• Key Stack Symbols:
dvacore::xml::GetParser
AXE8ExpatTerminate (in AXE8SharedExpat.dll)
WCrashHandler::operator=
Steps to Reproduce:
Create a folder containing 5+ simple .indd documents of two to four pages in length.
Run the following ExtendScript (.jsx) to batch export them to HTML:
JavaScript
target indesign
var folder = Folder.selectDialog("Select folder");
var files = folder.getFiles("*.indd");
for (var i = 0; i < files.length; i++) {
var doc = app.open(files[i]);
// Valid HTML export destination
var htmlFile = new File(files[i].parent + "/" + files[i].name + ".html");
// Export
doc.exportFile(ExportFormat.HTML, htmlFile);
// Close Document
doc.close(SaveOptions.NO);
}
Observed Behavior:
• File 1: Exports successfully.
• File 2-3: InDesign crashes silently or throws the error report immediately upon calling doc.close() or starting the next app.open().
• Attempted Workarounds (All Failed):
Forcing Garbage Collection ($.gc()) between iterations.
Purging Caches (app.purge(PurgeOptions.ALLCACHES)).
Adding $.sleep(3000) delays to allow file locks to release.
Running in UserInteractionLevels.NEVERINTERACT vs INTERACTWITHALL.
Analysis: The stack trace showing AXE8_ExpatTerminate strongly suggests a race condition or resource leak in the HTML/XML subsystem. It appears the XML parser instance created for the first export is not being correctly destroyed or released by the time the script initiates the second export cycle. When the application attempts to re-engage dvacore::xml::GetParser, it hits invalid memory.
Impact: Batch automation for HTML outputs is currently impossible in v21.1 without restarting the application instance for every single document.