Skip to content

Debugging & Hot Reload is Broken When App's Base Path is Changed #46809

Closed as duplicate of#45213
@daytonjallen

Description

@daytonjallen

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Debugging and hot reload is broken when app base path is changed in index.html and launchsettings.json.

Expected Behavior

Debugging and hot reload with a different base path should work

Steps To Reproduce

Repo reproducing problem here:
https://github.com/daytonjallen/HotReloadPathIssueRepro

  1. Start new blazor wasm project
  2. Update base path in index.html
  3. Update paths in launchsettings.json (problem exists when using both the IIS & http run configs)
  4. Try to debug project

App will fail to load due to exceptions from not finding blazor-hotreload.js etc:

image

Exceptions (if any)

blazor.webassembly.js:1

   System.AggregateException: One or more errors occurred. (Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js

TypeError: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js)
---> Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js
TypeError: Failed to fetch dynamically imported module: http://localhost:65439/_framework/blazor-hotreload.js
at Microsoft.JSInterop.JSRuntime.d__16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
at Microsoft.AspNetCore.Components.WebAssembly.HotReload.WebAssemblyHotReload.InitializeAsync()
at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHost.RunAsyncCore(CancellationToken cancellationToken, WebAssemblyCultureProvider cultureProvider)
at Program.

$(String[] args) in C:\Users\dallen\source\repos\HotReloadPathIssueRepro\HotReloadPathIssueRepro\Program.cs:line 11
--- End of inner exception stack trace ---

.NET Version

7.0.200

Anything else?

Visual Studio Version: 17.5.0

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Dev ExperiencePriority:1Work that is critical for the release, but we could probably ship withoutarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-hot-reloadThis issue is related to the Hot Reload feaature

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions