Ogmo-Editor-3 / OgmoEditor3-CE

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

[Bug] Can't build for Mac Book Air M1 (BigSur OS) #185

Closed amidos2006 closed 3 years ago

amidos2006 commented 3 years ago

I tried to follow the build process in the README.md file on my new Mac Book Air M1 and I got the following errors when I run npm run build

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/Settings.hx:145: characters 10-18 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/level/editor/ui/LevelsPanel.hx:390: characters 24-32 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/level/editor/ui/LevelsPanel.hx:404: characters 23-31 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/level/editor/ui/LevelsPanel.hx:420: characters 24-32 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/level/editor/ui/LevelsPanel.hx:537: characters 11-19 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module Error (from ./node_modules/haxe-loader/index.js):
/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src/level/editor/ui/LevelsPanel.hx:722: characters 10-18 : Class<electron.Shell> has no field openItem

ERROR in ./app.hxml
Module build failed (from ./node_modules/haxe-loader/index.js):
Haxe Loader: Compilation failed
haxe -D webpack_namespace=app -lib electron -lib jQueryExtern -lib haxe-loader -cp "/Users/ahmedkhalifa/Downloads/OgmoEditor3-CE-master/src" -dce full -js /tmp/tmp-33636aG3AruNtNRua.js -main App -D "build_mode=production"
AustinEast commented 3 years ago

Hey! Looks like you may have the wrong haxelib version of electron. We're currently using 4.1.4 (you can install it with haxelib install electron 4.1.4).

amidos2006 commented 3 years ago

That is the one I have installed on my machine. Here is the haxelib list output:

electron: 4.1.4 [11.3.0]
haxe-loader: [0.9.0]
hxnodejs: [12.1.0]
jQueryExtern: [3.2.1]
AustinEast commented 3 years ago

So you currently have version 11.3.0 set - try haxelib set electron 4.1.4

amidos2006 commented 3 years ago

Thanks a lot, it worked but I needed to install webpack which was not specified in the readme :) But everything worked now :) sorry my bad

AustinEast commented 3 years ago

Glad it worked! webpack should have installed when you called npm i though 🤔

Its listed here in the package.json - https://github.com/Ogmo-Editor-3/OgmoEditor3-CE/blob/master/package.json#L31

amidos2006 commented 3 years ago

Yeah, I can see it but npm i had a couple of problems that I needed to call npm audit fix. That might be the problem why it was never installed and I had to install it manually.