![]() We don't actually have a directory for /MyPage as it is just a route that we have defined in Blazor to make the experience of using the website better for the user. MyPage that has an index.html file available to serve. If it sees something that looks like a directory in the URL after the expected then it will assume that you have some folder e.g. The problem occurs because of how GitHub Pages serves files. If this is your site, make sure that the filename case matches the URL.įor root URLs (like ) you must provide an index.html file. The site configured at this address does not contain the requested file. But if we try to access this URL directly we will be faced with the following page. We can nicely go to this page using the navigation in the website or when we run the project locally. Then we might have an URL like the following: If we have some Blazor WASM page that is hosted on GitHub Pages that uses routing meaning that it has more than one page. GitHub Pages is not configured to support SPA (Single Page Application) routing out of the box, but we can make some changes to our project to make it work.įirst, we need to see when the problem occurs. We can't do this when using static file hosts. Previously we have often used the IIS to host our websites and managed routing and error handling through the web.config file. In this article, we will look at the 404 error that often occurs when accessing a route directly on a GitHub Pages hosted Blazor WASM page and how to fix it. A problem with this is that routing is handled in many different ways on different hosts. One of the nice things about Blazor WASM is that it can be hosted by any static file host. The project structure of a Blazor WASM project is in some places very different than other frontend frameworks in the. Written by Kristoffer Strube, April 06, 2021
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |