Hi,
I have upgraded to the latest Lime-Openfl, and now I receive this error from Haxe Develop while compiling:
Length cannot be less than zero.
Parameter name: length
in System.String.Substring(Int32 startIndex, Int32 length)
in HaXeContext.ExternalToolchain.Run(String command)
in HaXeContext.PluginMain.HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
in PluginCore.Managers.EventManager.DispatchEvent(Object sender, NotifyEvent e)
It looks like Substring receives -1 as length.
Did you receive the same error?
The problem didn’t appear with the previous Openfl/Lime versions.
I know that it could be an HaxeDevelop error, but I’d like to know if someone got the same error and how often, because in my case it doesn’t popup at every compile, it looks pretty random.
I was getting the same error with HaxeDevelop with recent openfl/lime versions. Sometimes restarting HaxeDevelop did help. And i agree seems pretty random issue. As i’m switching between different versions not sure what version did have this problem.
I switched from Lime 7.2.1 + Openfl 8.8.0 to Lime 7.5.0 + Openfl 8.9.1, but I am pretty sure to remember that I skipped the intermediate versions for the same issue.
Restarting HD or reselecting the project more than once sometimes help, but I think I will jump back to the old libraries to avoid wasting further time.
Yes, maybe an unhandled exception in HD, but with the old Lime-Openfl versions this didn’t happen.
I am not in a good position to install dev versions of HaxeDevelop, and the latest official version is more than 1 year old.
I also updated a lot of haxe libraries (details below) and since then I get the same error
The Error on FlashDevelope (haxe project):
Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at HaXeContext.ExternalToolchain.Run(String command)
at HaXeContext.PluginMain.HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
at PluginCore.Managers.EventManager.DispatchEvent(Object sender, NotifyEvent e)
My updated libraries:
haxelib → 4.1.0
Update actuate to 1.9.0
Update crypto to 1.0.4 [y/n/a] ? n
Update feathersui to 1.3.0 [y/n/a] ? n
Update haxe-strings to 7.0.5 [y/n/a] ? y
Update hxargs to 4.0.0 [y/n/a] ? y
Update lime to 8.2.2 [y/n/a] ? y
Update hxcpp to 4.3.2 [y/n/a] ? n
Update hxnodejs to 12.2.0 [y/n/a] ? n
Update openfl to 9.4.1 [y/n/a] ? y
The exception appears to be happening here in FlashDevelop’s source code:
It looks like it is searching for the last index of the / character in the line that starts with -js in the project’s .hxml file. For OpenFL projects, the .hxml files are generated in the output directory when running lime build html5. There’s also the lime display html5 command, which outputs it in the terminal.
That’s all I can say without seeing the contents of one of your project’s actual .hxml files.