Black screen without errors HTML5

I use openfl 4.9.1 and lime 4.0.2. But in the browser I see only black screen without errors in console tab. In network tab I see, that was loaded project/, howler.min.js, pako.min.js, js-file project and my custom js-file.

have you tried adding traceā€™s to check that your project is running ? e.g.

trace("helloo world");

and what were you hoping to see in the sceen when your project runs ?

Itā€™s happening with me as well. The app main never starts.

Nothing in trace. I hope to see background image, which I load.

@Jarkony The lime embed function changed
In your app entry point (usually index.html) use:
lime.embed ("::APP_FILE::", "canvas-wrapper", ::WIN_WIDTH::, ::WIN_HEIGHT::, { parameters: {} });

this worked for me. :grinning:

I had:

lime.embed ("openfl-content", 1200, 650, "CCCCCC");

I pasted:

lime.embed ("::APP_FILE::", "canvas-wrapper", ::WIN_WIDTH::, ::WIN_HEIGHT::, { parameters: {} });

And now I see error in console in pasted line:

Uncaught SyntaxError: Unexpected token :

The ā€œcanvas-wrapperā€ was just my div element. You should keep it on "openfl-content"
Eg -
lime.embed ("::APP_FILE::","openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, { parameters: {} });

Also keep your width and height

Can you share your case with your real parameters, please?

This is my output:

lime.embed ("data/js/app", "canvas-wrapper", 0, 0, { parameters: {} });

Thanks, can you share link where you saw how it make?

Cool, no prob. I created the openfl sample project - PiratePig.
cli : ```
openfl create PiratePig && cd PiratePig && openfl build html5

You can basically see the output in the Export folder of this project

Okay, thanks! Does your project work in Firefox and IE? I see only grey screen with line-loader.

Alternatively in the openfl Library go to:

templates/html5/template/index.html

Mine is workingā€¦ Also iā€™m using an custom preloader.

As far as I understand, there are three types of rendering mode in openfl . And for me canvas mode works and has solved the problem like this in the past.

Try using this tag inside project.xml

tagstart haxedef name=ā€˜canvasā€™ tagclose

This happened with me using firefox/safari on mac. But not on windows. Using above tag solved the problem.

It was due webp. For some reason, firefox donā€™t supports webp-format.

Im working with FlashDevelop and has some problem any time. If u test some project in html, then test other project - local use older index.html template. Use f5 to reload local and see - now new index loaded.

I have had this problem using FlashDevelopā€™s HTML target as well. I would currently recommend using either build in FlashDevelop (and not run) for HTML5, and keeping a separate window open where you have done openfl run html5 to boot up our server (which has caching disabled), or use openfl test html5 in a separate window when you want to test, and not building in FlashDevelop