YeGaSoft / DnDCharCtor

Test-Project for a `Blazor Hybrid` and `WebAssembly PWA` App
MIT License
0 stars 0 forks source link

Blazor WebAssembly + GitHub Pages - Due wrong redirects in GitHub Pages #17

Closed YeGaSoft closed 3 days ago

YeGaSoft commented 3 days ago

Currently, when trying to Deploy the Blazor WASM to GitHub Pages it cannot load most resources (CSS, Scripts & Co) due a 404. This might be due a misconfigured Deployment since some of the expected paths exist, but the files don't.

YeGaSoft commented 3 days ago

404 could be "fixed". The problem was we used DnDCharCtor.Pwa instead of DnDCharCtor in sed. But currently the Redirects are wrong. It redirects to the Base-URL (which we use intern) instead of /DnDCharCtor. You can see that it correctly loads the Start-Page (/ or /DnDCharCtor in GitHub-Pages) but then redirects to /editCharacter instead of /DndCharCtor/editCharacter in GitHub-Pages. This problem is only after Deployment on GitHub-Pages. When we manually enter the Url that GitHub-Pages expects then everything works fine.

YeGaSoft commented 3 days ago

Fixed with: https://github.com/YeGaSoft/DnDCharCtor/commit/82eaacccb6c21bb8f7e7a3fd7bd147ddf12bbe43

The problem was that we Routed to example /editCharacter but we should have used NavigateTo("editCharacter") instead of NavigateTo("/editCharacter") since our Root in GitHub-Pages is /DnDCharCtor and not / and if we Prefix / it'll try to Navigate to (for example) /editCharacter instead of /DnDCharCtor/editCharacter`.