Issue with running OpenFL in Lix

Hello,

I recently decided to start migrating my project to use lix for dependency management. When I try to do:

lix run openfl setup

I get this error:
: haxelib run-dir lime C:\Users\sgalland\AppData\Roaming/haxe/haxe_libraries/lime/7.7.0/haxelib setup -openfl
Failed to invoke haxelib run-dir openfl C:\Users\sgalland\AppData\Roaming/haxe/haxe_libraries/openfl/8.9.6/haxelib setup because Error: Command failed: haxelib run-dir openfl C:\Users\sgalland\AppData\Roaming/haxe/haxe_libraries/openfl/8.9.6/haxelib setup

Has anyone been able to make this work?

Thanks,
Sean

1 Like

Have same issue, trying to find solution

Lix is working as long as you use a global installation. I found no solution with a local installation of lix :frowning: Just install lix and add this to your vscode settings:

"settings": {
	"lime.projectFile": "client.xml",
	"lime.executable": "lix lime",       <------ THIS IS IMPORTANT!
	"files.autoSave": "afterDelay",
	"files.autoSaveDelay": 500,
	"debug.openExplorerOnEnd": true,
}

On the command line, don’t use “lix run openfl”, just “lix openfl”. this worked for me.

If you do a global installation of lix, take note that if you ever decide to remove lix and go back to a regular installation of Haxe, you’ll probably need to do some extra manual cleanup of things that Lix leaves behind. Lix doesn’t restore everything back to its original state when you remove it, and parts of Haxe will be broken until you figure out how to get rid of the rest (even with a fresh installation of Haxe). I might have an easier time if I did it again, but it was a pretty rough mistake that I made when I was a beginner to Haxe.

IIRC haxelib run openfl setup merely registers an alias on your command line so that openfl <args> becomes haxelib run openfl <args>. That is not meaningful for lix users anyway because the alias should have pointed to lix run openfl <args> instead. So I think the setup step should be skipped.

1 Like

So I bit the bullet and installed Lix. I didn’t have to modify the Lime settings as mentioned above. I have it compiling successfully using OpenFL 9.2.0 and Lime 8.0.0.

My one problem now is that when compiling with the -debug flag, all the traces in the browser console map back to “Log.hx” in whichever version of Haxe the project uses. Prior to that they would map to the line in my project.

My workaround for now is inserting js.Lib.debug(); to force a break, but if anyone has a solution for fixing the console links that would be great.

Having said that, I was having problems with code completion until I changed the “lime.executable” to “lix lime” as suggested above. Works now.

For the record, those settings are found in the Lime Extension Settings (click the gear icon on the extension) in VSCode.