I got the same following the Hello World / Hello Hashlink examples.
There is no package defined in these examples. I did try adding one in case it was always expecting a package but the error persists.
Turned out the issue was the comments in the hxml file - for some reason it was not recognising the comment at the end of the -main line, and was trying to load “Main # Tells haxe to […]” as the entry point.
I just moved the comments on to their own lines and everything works (note this is the hashlink hxml):
# Tells haxe where to search for your code files
# Tells haxe to import the heaps library
# Tells haxe to import the hlsdl rendering library
# Tells haxe to compile to hashlink bytecode in the project directory
# Tells haxe that Main.hx is your entry point
# Tells haxe to run in debug mode