Ogmo-Editor-3 / OgmoEditor3-CE

The Community Edition of Ogmo Editor 3
https://ogmo-editor-3.github.io
MIT License
502 stars 48 forks source link

Build fails on Windows #208

Open hubol opened 2 years ago

hubol commented 2 years ago

I updated electron to 12.0.4 with haxetoolkit. When I run the build or dev script I get:

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
C:\Users\Hubol\Projects\ogmo-editor\src/util/AppMenu.hx:94: characters 51-59 :  have: Array<{ ?type, ?submenu, ?role, ?label, ?click, ?accelerator }>

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
C:\Users\Hubol\Projects\ogmo-editor\src/util/AppMenu.hx:94: characters 51-59 :  want: Array<haxe.extern.EitherType<..., ...>>

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
C:\Users\Hubol\Projects\ogmo-editor\src/util/AppMenu.hx:94: characters 51-59 : For function argument 'template'

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
C:\Users\Hubol\Projects\ogmo-editor\src/util/AppMenu.hx:94: characters 51-59 : error: { ?type : Null<String>, ?submenu : Null<Array<util.MenuTemplate>>, ?role : Null<String>, ?label : Null<String>,
?click : Null<Void -> Void>, ?accelerator : Null<String> } should be haxe.extern.EitherType<Dynamic, Dynamic>

ERROR in ./app.hxml
Module build failed (from ./node_modules/haxe-loader/index.js):
Haxe Loader: Compilation failed
haxe -debug -D webpack_namespace=app -lib electron -lib jQueryExtern -lib haxe-loader -cp "C:\Users\Hubol\Projects\ogmo-editor\src" -dce full -js C:\Users\Hubol\AppData\Local\Temp\tmp-53405ZWQ7NtXWP
ec.js -main App -D "build_mode=development"

The line in question is: https://github.com/Ogmo-Editor-3/OgmoEditor3-CE/blob/8823acd2cdcac16e9b5f1f9600e3b7d885512ec0/src/util/AppMenu.hx#L94

If I suppress the error with a cast, like this, it works fine:

var menu = electron.main.Menu.buildFromTemplate(cast template);

Is the build broken for others?

AustinEast commented 2 years ago

What version of Haxe are you running? A couple of Haxe releases have come out since any major work has been done on Ogmo, so some changes for compatibility may be needed.

hubol commented 2 years ago

Haxe Compiler is 4.1.3!