emscripten-core / emscripten-core/emscripten

--preload-file works when running locally but not when deployed as a github page

Open
#22,100 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Hello,
I'm trying to catch what I'm maybe doing wrong but after a bunch of hours I'm sort of giving up.

I'm packing some data under a folder ( specifically a `.ttf` file and a `.png` ) and when I build and run locally ( through `emrun` ) the resources are loaded correctly. I can see the font being visualized correctly ( I'm using ImGui ) and the image looks good as well ( I'm using OpenGL and stb_image to load it ). Here's a little screenshot:
![image](https://github.com/emscripten-core/emscripten/assets/7666672/cc912ea8-8302-4ced-9643-b514926f9233)

I created a workflow action in github to deploy the files as a github page but this is what I get instead:
![image](https://github.com/emscripten-core/emscripten/assets/7666672/a3a3510d-eed0-4c9f-93a5-ebfb5d692dd4)

It looks like the files are actually loaded ( I don't get asserts or errors from ImGui or stb_image ) but the font seems to be ignored and the image is entirely black. I'm guessing there's something I should setup in order to have the github page working properly.

Are there any aspect I should keep in mind which are automatically addressed when running the webserver locally through `emrun`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.