Kha icon indicating copy to clipboard operation
Kha copied to clipboard

ReferenceError: audio is not defined

Open tienery opened this issue 6 years ago • 4 comments

I am trying to build for the Windows target and I am unsure why I am getting this error.

Using Kha from C:\Users\Luke\Documents\GitHub\Kha
Creating Kha project.
Exporting asset 1 of 2 (Sunflower-Light.ttf).
Exporting asset 2 of 2 (Parallax_Morrowlands_Hills.png).
Compiling shader 1 of 8 (painter-colored.frag.glsl).
Compiling shader 2 of 8 (painter-image.frag.glsl).
Compiling shader 3 of 8 (painter-colored.vert.glsl).
Compiling shader 4 of 8 (painter-image.vert.glsl).
Compiling shader 5 of 8 (painter-text.frag.glsl).
Compiling shader 6 of 8 (painter-text.vert.glsl).
Compiling shader 7 of 8 (painter-video.vert.glsl).
Compiling shader 8 of 8 (painter-video.frag.glsl).
korefile found.
Creating Windows project files.
ReferenceError: audio is not defined
SyntaxError: Unexpected identifier

Is this an internal Kha error in the NodeJS build system? I've updated to the latest version of Kha, but these errors are so lacking and give hardly any information. Is there a log that Kha's build system generates so that I can copy/paste here?

Also, it would be useful to have the WIKI up-to-date on how to compile for the Windows target, because it may just mean installing some prerequisites.

I am on Windows 10 Pro. Kode Studio 17.9.1 Haxe version 3.4.4.

tienery avatar Jun 18 '18 11:06 tienery

I think it is an internal error in the node build system - looks like an actual js error. Haven't seen anything like that before though. What's your node version?

RobDangerous avatar Jun 18 '18 11:06 RobDangerous

Forget that, you're building directly in Kode Studio, right? In that case the node version is irrelevant but can you try to build on the command line, see if that brings up anything else? Also, does that happen with any of the sample projects as well?

RobDangerous avatar Jun 18 '18 11:06 RobDangerous

Yes, it built fine from the command line. Perhaps it's a Kode Studio-specific problem, then. That's the only thing I can think of. Perhaps it's because I don't have a Kha folder in the project, I use a specific directory where Kha is installed (not haxelib). Is Kode Studio not checking that the directory Kha exists inside the project root folder first before deciding to call the "node Kha/make" command internally? Perhaps that's why these unusual errors are happening.

tienery avatar Jun 18 '18 11:06 tienery

It does. In you project it decides to call you global Kha, so your project does not have a Kha subdir, right? I use Kha and Kode Studio like that myself all the time and it works fine. Did you use the same Kha when compiling on the command line?

RobDangerous avatar Jun 20 '18 06:06 RobDangerous