Consider advising users not to use Trunk for wasm builds, or warn them about some caveats #253
Labels
C-bug-misleading
Wrong or misleading information in the book
C-enhancement
New content that isn't covered already
P-web
Platform: Web Browser
S-platforms
Content about developing for a specific target platform
Z-medium
medium task that needs moderate time investment
It seems like people love using trunk, but there are a number of ways using trunk can bite you. I totally agree with the decision to not give full blown instructions for a tool that you don't use / aren't familiar with. So I'm not totally sure what the right thing to do in the cheatbook is.
I've collected what I know about trunk (I am also not a trunk user) based on trying to help bevy users use it. I'll toss that information down below.
Trunk's dev web server is meant for SPAs, but bevy's asset server needs the web server to serve
404
s for missing assets. By default when there is a missing file, trunk just serves200
with the contents ofindex.html
as the response body.It's a bit hard to follow what has been going on with trunk with regard to this issue. There are a number of old GH issues. There was a fork
trunk-ng
that added a--no-spa
flag. That fork was seemingly "unforked", but I don't think that the option has made it into a release yet?The html file produced uses absolute paths to reference js/wasm files. This assumes the project is being placed on its own server at the web root. That might be true in a lot of cases, but it creates a great deal of confusion when deploying to itch. On itch, your project is in a subdirectory and the CDN serves missing files as
403
errors.I am not sure if there is a workaround for this, other than manually editing the produced html to use
./
instead of/
.The asset folder must be configured with copy-dir.
The text was updated successfully, but these errors were encountered: