问题
I have just started with Haxe/Flambe, but I seem to have a problem compiling to HTML. From what I can tell it's an internal problem. It compiles to Flash just fine. Here's my console output
C:\Users\UserName\Dropbox\Projects\Project\Game>flambe build --debug html
Building: build/web
haxe -main game.Main -lib flambe -cp src -dce full -debug --no-opt --no-inline -D html -D js-es5 -D js-flatten --macro flambe.platform.ManifestBuilder.use("build/web/assets") -D source-map-content -js
build/web/targets/main-html.js
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlPlatform.hx:76: characters 8-41 : js.html.DOMElement should be js.html.Element
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be haxe.io.BytesData
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be js.html.ArrayBuffer
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : For function argument 'b'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:39: lines 39-45 : Missing return haxe.io.Bytes
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:364: characters 16-38 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:367: characters 12-37 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:368: characters 16-42 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:205: characters 12-43 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : js.html.Window should be haxe.Function
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : For function argument 'func'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:25: lines 25-38 : Missing return Dynamic
I am using Haxe 3.2.0 and Flambe 4.1.0. I have been crawling the internet looking for a solution, but couldn't seem to find one. Any help would be much appreciated. Thanks.
回答1:
If you want to use Flambe with Haxe 3.2, you should apply this patch:
https://github.com/aduros/flambe/commit/ec084011873cf16635f4e2a77cc0d2dc6c58625d
回答2:
Alright, well downgrading Haxe 1.3.1 seemed to fix the problem.
Here are the steps in case anyone else comes across this.
1) Go to C:\HaxeToolkit and there should be an uninstall.exe, run that to uninstall Haxe.
2) Install Haxe 1.3.1 from here: http://haxe.org/download/file/3.1.3/haxe-3.1.3-win.exe
3) Run the following commands from cmd to install flambe:
npm install -g flambe
flambe update
Hope this helps anyone who had the same problem.
来源:https://stackoverflow.com/questions/32448244/flambe-html-compile-issue