Engine crashes when loading a WIP `.nlogo` file
Open
@omargfh is already working on this.
Since Sep 15, 2026.
- Dominant language
- CoffeeScript
- Stars
- 65
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
Engine crashes when loading a WIP .nlogo file
Discovered while addressing #461.
Steps to recreate
- Navigate to NetLogo Web Launch
- Load a
.nlogomodel file - Enter authoring mode and make some changes
- Reload the page and load the same
.nlogofile again - Expect the engine to crash
Error Message
There was an error compiling the model's code. The given model was not a NetLogo 7 .nlogox file or a NetLogo 6.4 .nlogo file.
Check that you selected the correct file to upload.
The model contents that failed to compile are given below.
<?xml version="1.0" encoding="UTF-8"?> <model version="NetLogo 7.0.4" nlw-version="2.16.0 (4690bbb3)"> ... </model>
Investigation
The crash is a format mismatch between the original file and the cached changes.
- When a model is edited, the work-in-progress listener stores the result of
SessionLite.getNlogo(), which always callscompiler.exportNlogoXML. So the cached copy is nlogox XML regardless of the format the model was loaded from. - On the next load,
Tortoise.fromNlogodecides which parser to use by callingnlogoSource.isOldFormat()on the original source. For a legacy.nlogofile that returnstrue, so the cached XML is handed tofromNlogoSync.
This bug will be addressed in the same PR as #461.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.