Skip to content

When Blazor WASM PWA app is hosted in subdirectory and published to Azure service-worker makes requests to wrong path. #31801

@Hristo-Nikodimov-Nenkov

Description

Describe the bug

When Blazor WASM PWA application is hosted in subdirectory and published in Azure service-worker.js makes requests to
https://multiclientapp.azurewebsites.net/Store/Store/{asset} instead to https://multiclientapp.azurewebsites.net/Store/{asset}
and even to https://multiclientapp.azurewebsites.net/Store/Store/Store/MultiClientApp.ClientApps.Store.styles.css instead of https://multiclientapp.azurewebsites.net/Store/MultiClientApp.ClientApps.Store.styles.css

To Reproduce

https://github.com/Hristo-Nikodimov-Nenkov/MultiClientApp

Published at https://multiclientapp.azurewebsites.net

Created MultiClientApp project with Blazor WebAssembly template with checked hosted and PWA.
Remove the client application.
Add new Blazor WebAssembly project named ClientApps.Store with PWA checked.
Change project name to MultiClientApp.ClientApps.Store
Add Store to project.
Change base href to "/Store/"
Add referance to client project in MultiClientApp.Server
Add app.MapWhen to Server's Startup.cs Configure method.

Exceptions (if any)

In Chrome DevTools console
Failed to find a valid digest in the 'integrity' attribute for resource 'https://multiclientapp.azurewebsites.net/Store/Store/css/app.css' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Unknown error occurred while trying to verify integrity.
service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions