0

I have a Blazor page that works fine when I navigate to it via URL links and the menu. Once on the page, though, if I hit the Chrome Refresh button I get a long list of 404 errors for all the CSS and JS files I've included. This also happens if I type in the URL to go directly to the page. The Index.razor page loads fine. A-tags and NavigationManagers also work as expected. The URL is "https://localhost:5001/OrderEdit/223821" where OrderEdit is the page name and is followed by the order number. The page directives look like this

@page "/OrderEdit"
@page "/OrderEdit/{OrderNumStr}"

When I refresh the page, I get this (cut short for brevity)

GET https://localhost:5001/OrderEdit/bootstrap/css/bootstrap.min.css?v=1 net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/Chart.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/app.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/site.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/bootstrap/css/custom.css?v=1 net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazorise/blazorise.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazorise.Bootstrap/blazorise.bootstrap.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/AntDesign/css/ant-design-blazor.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazored.Typeahead/blazored-typeahead.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/BlazorDateRangePicker/daterangepicker.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Sotsera.Blazor.Toaster/toastr.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_framework/blazor.webassembly.js net::ERR_ABORTED 404
3
  • 1
    Do you have a <base href="/" /> in the head of your index.html? It looks like not - as it is trying to fetch static files from /OrderEdit Commented Jun 21, 2021 at 22:55
  • Have you cleared out browser storage for localhost:5001 from the Application tab (or Storage in FF)? Commented Jun 21, 2021 at 22:56
  • Nice! Thanks Mister Magoo, the <base href="/"> did it. Commented Jun 22, 2021 at 4:55

1 Answer 1

3

Do you have a <base href="/" /> in the head of your index.html? It looks like not - as it is trying to fetch static files from /OrderEdit

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.