C
C#2y ago
KimPiks

❔ Blazor wasm not loading in github pages

Hi, I'am having trouble deploying my blazor wasm app (dotnet 7) on github pages. The app is loading, but no pages, or components are displayed. There are no errors shown in the browser console. I followed this tutorial (https://swimburger.net/blog/dotnet/how-to-deploy-aspnet-blazor-webassembly-to-github-pages), compared my repo with this https://github.com/mammadkoma/MySite/tree/gh-pages (the application works on it) and I can't figure out what's wrong. Does anyone have any ideas about what might be wrong? dotnet.yml (github actions file) https://pastebin.com/sQGA6uju index.html https://pastebin.com/RUkNSQde
2 Replies
ZacharyPatten
ZacharyPatten2y ago
can you link your repo? also, personally I would recommend you jsut do the git commands yourself and not use
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: release/wwwroot
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: release/wwwroot
that action is literally only doing ~5 lines of code for you so just write the code yourself Here is one of my github actions that does the same thing without needing a dependencies on another github action:
- name: push to github-pages branch
run: |
cd Projects/Website/bin/Release/publish/wwwroot
git init --initial-branch=github-pages
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m 'deploy to github-pages branch'
git push --force "https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" github-pages:github-pages
- name: push to github-pages branch
run: |
cd Projects/Website/bin/Release/publish/wwwroot
git init --initial-branch=github-pages
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m 'deploy to github-pages branch'
git push --force "https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" github-pages:github-pages
that is from my project here: https://github.com/dotnet/dotnet-console-games/blob/main/.github/workflows/Website%20Deploy.yml
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server