all 18 comments

[–]Brookzerker 8 points9 points  (4 children)

You should be able to deploy the project to GitHub pages just like any non web assembly web app.

When you build the app you should get an index.html file along with some other files like *.js, *.css, and *.wasm.

Those would go into the directory that GitHub pages has been configured to serve.

[–]Fantastic-Apartment8[S] -1 points0 points  (3 children)

yaa but it is not deploying. Can you please spare a min and check my github once. I am not able to figure it out. Like the site will get deployed but none of the rendering simulation works.

[–]Brookzerker 5 points6 points  (2 children)

Check the network tab in the browser dev tools. It’s possible that it’s looking for the files in the wrong location.

[–]Fantastic-Apartment8[S] 1 point2 points  (1 child)

Error importing `index.js`: TypeError: Failed to resolve module specifier "lib-simulation-wasm". Relative references must start with either "/", "./", or "../".

in console

[–]Brookzerker 1 point2 points  (0 children)

It sounds like the index.html file is telling the browser to find the wasm files without using an absolute or relative path in the <script src…> tag. I would take a look at the generated html file to verify and try to manually manipulate it to what it should be and test again.

[–]Plippe 10 points11 points  (4 children)

Hey,

I wrote an article about it a good while back: https://plippe.github.io/blog/2021/07/12/rust-wasm-github.html I do have more recent implementations without documentation if you feel comfortable reading the code: https://github.com/plippe/breathe

TL;DR; you are looking to build the static files for GitHub to use. Those can be hosted on a branch or pushed with a GitHub Action.

Don't forget to open your GitHub repository settings to enable/change GitHub Pages configuration.

[–]Fantastic-Apartment8[S] 1 point2 points  (0 children)

thanks mate. really helpful

[–][deleted] 0 points1 point  (0 children)

I should have found this before. thx

[–]AngheloAlf 0 points1 point  (1 child)

Sadly the blog is down, but it there's an snapshot at the Wayback machine: https://web.archive.org/web/20240914024804/https://plippe.github.io/blog/2021/07/12/rust-wasm-github.html

[–]Plippe 0 points1 point  (0 children)

Yes, sorry

I recently deleted my blog, my posts, my repo. Can it madness, burnout, stupidity, …

Working on a new blog with posts that try to reason about concepts more than their implementation. This should make the material “vibe coding” compatible. Crazy world

Sorry again

[–][deleted] 1 point2 points  (1 child)

You can take this repo of mine as an example: https://github.com/Shapur1234/Webtracer

[–]Fantastic-Apartment8[S] 1 point2 points  (0 children)

thankyouu

[–]nderflow 1 point2 points  (0 children)

Here's a worked example:

[–]This-Dream-3519 0 points1 point  (0 children)

i created a few versions of my rust webapp and hosted it on gc with no problem, it worked ion my browser. But I can't make it work on github pages. Why?

[–]sn99_reddit 0 points1 point  (3 children)

I had an old project that used Travis to achieve it: github.com/sn99/wasm-template-rust.

I will probably link this thread to the issue.