Page MenuHomeFeedback Tracker

Compile error messages fail to give the correct script file name
Confirmed Internally, NormalPublic

Description

This is an old problem, but it is a very annoying one: Compile error messages never give the file name of the file that actually contains a compile error, instead, it seems to always be the file name of the last successfully compiled file (with line number pointing to EOF of that file).

This is misleading and makes debugging harder than it needs to be, so much so in fact, that I think it would be better if these error messages didn't give a file name at all but just the raw error ("Unknown type <xyz>" / "Undefined variable <xyz>" etc) in case there is no easy fix for the underlying problem.

For modders, it also leads to a barrage of bogus bug reports for errors that are not actually related to their project.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

E.g. have a script reference a class that's never defined (e.g. if a required addon is not loaded)

Event Timeline

lava76 created this task.Aug 5 2022, 2:25 PM
lava76 edited Steps To Reproduce. (Show Details)

anything for better error messages everywhere

Geez changed the task status from New to Need More Info.Aug 9 2022, 3:10 PM
Geez added a subscriber: Geez.

Hello lava76.
We have not found any problems after running some tests.
Can you please provide us with more information to produce this issue?
Regards,
Geez

I've attached a minimal example modding a non-existent class. If this PBO is loaded with at least one other mod (this seems to be the important part), then the filename in the error message points to last line/EOF of some unrelated script.

In this example the other mod I've used was Community-Framework simply because it's so widely used, I imagine others will work or rather break in the same fashion.

Server commandline (serverDZ is completely vanilla, I haven't actually uploaded the test mod to the Workshop just signed and copied it locally):

DayZServer_x64.exe -port=2302 -config=serverDZ.cfg "-mod=C:\Games\Steam\steamapps\common\DayZ\!Workshop\@CF;C:\Games\Steam\steamapps\common\DayZ\!Workshop\@CompileTest"

Error message I got (points to last line of of jmmodulemanagerbase.c):

Can't compile "Game" script module!

JM/CF/Scripts/3_Game/communityframework\module\deprecated\jmmodulemanagerbase.c(128): Unknown type 'CompileTest'

Geez changed the task status from Need More Info to Confirmed Internally.Aug 10 2022, 1:58 PM