How to troubleshoot Not_Found errors when compiling to cs

I am continusly working on a dual target project, where I am sharing types between javascript and csharp.

I am working a few days on the js side, and than a few days on the csharp side, I usualy have a few issues to correct on every toggle, however I find it to be easy and enjoyable.

Today when coming from JS to CS I see a mystarious short error

haxe  .\conv_sys.hxml
Not_found

Its not easy for me to reason about which one of the numerious changes I’ve made during the week have caused that issue.

I checked with procmon, I could see haxe.exe trying to access this file E:\abletop\. (notice the period) and it fails for being invalid name, maybe this is related.

Could anyone explain what the error means, and where I could get some stacktrace or location to understand whats causing the issue?

Hi

After working an hour, I’ve almost finished of my list, and I was able to Identify the problamatic change.

enum abstract MessageDirection(Int) from Int to Int {
    var WmsToSwift=0;
    var SwiftToWms=1;
}
//public var message_direction:Null<MessageDirection>;
   public var message_direction:MessageDirection;

The commented line was causing the issue Not_found error

The question here remains, why would a nullable enum abstract cause that message? as well as what is the proper way to handle null in a enum abstract in a static target?

Thanks

If you run haxe in verbose mode with -v, so haxe -v .\conv_sys.hxml in your case, it’ll print the file currently being parsed/typed by the compiler.

The last one is often the culprit for such errors.

Also doing that is useful to debug if the compiler seems to be in a infinite loop.

The Not_found looks like a compiler bug, if you manage to make a small example reproducing the bug please open an issue on github Issues · HaxeFoundation/haxe · GitHub.

Thanks for the insight.

So far a minimal example is working perfectly, so my assumption of the general cause is wrong, I’ve indeed confirmed that in my case adding the Nullable would toggle the error on or off, If I will bump in again I will try to find a common denominator, and make a minmal example.

Maybe some other forum users would relate this error to some other error in the future.

The following is working.

enum abstract MessageDirection(Int) from Int to Int {
    var WmsToSwift=0;
    var SwiftToWms=1;
}
class TesBug {
    
    public var message_direction:Null<MessageDirection>;
    static function main(){
        var message_direction;
        message_direction=WmsToSwift;
        trace(message_direction);
    }
}