For some reason, whenever I try and run my code with the Haxe compiler, it gives a message like “Type not found : openfl.display.Sprite”. If I remove the import statement for openfl.display.Sprite, the same thing happens with the next import, Sprite just happens to be first on my list. The strange part of this is the fact that I can still test my project from terminal, and it runs without issue (for example, I use terminal to type “openfl test neko” and it renders my stage). From what I’ve seen, everything else recognizes OpenFL, and it can run with no problems. I have no issue when I try importing a Haxe standard library, such as Std.int.
To troubleshoot, I’ve looked through the project.xml file, found the source of my OpenFL library, and tried reinstalling both Haxe and OpenFL. Nothing seems to be wrong in any of those fields.
As for my import code, I’m fairly certain it is all correct:
What exactly do you mean by this? You normally don’t invoke the Haxe compiler directly directly in an OpenFL project, only indirectly through the OpenFL / Lime command line tools.
I’ve been using VSCode as my text editor (With required Haxe and Lime extensions), and whenever I run the code, I get the error I described. I’m fairly certain that the command it uses to do so is haxe --cwd “/Users/myname/Desktop/SimpleTilemap/Source” --run Main. Even outside of VSCode, running the Haxe command on my project doesn’t recognize the import statements importing OpenFL packages.
The reason I want to do this is to use the Haxe trace() function in order to debug.
I do in fact have that installed, though I didn’t think that was a problem because the command line didn’t work either (using the command in my previous reply). When I did Command+Shift+B and did “lime: build (active configuration)” my terminal window in VSCode said
Executing task: lime build html5 —connect 6000
Terminal will be reused by tasks, press any key to close it.
And nothing happens. I also tried doing this with the code runner extension disabled.