[browser] Assembly search path should be relative to the blazor.boot.json, not the importing module. #99539
Labels
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
Milestone
Description
When finding .wasm files in
detect_features_and_polyfill
, thescriptUrlQuery
variable is derived from the importing module (import.meta.url) instead of where the blazor.boot.json file is, and there does not appear to be any way to configure it to look in a different path.This means that bundlers which generate a module which imports the dotnet runtime will struggle to put the generated module into a _framework folder alongside the rest of the .NET/wasm assets.
Reproduction Steps
Create a vite project, import a .NET wasm assembly based project, build the vite project.
Expected behavior
The default behavior for loading .wasm files should be that it loads from the same directory as the blazor.boot.json file, or else provide a configuration (ala ".withConfigSource()") which allows the caller to specify where the .wasm files are stored.
Actual behavior
the bundled javascript attempts to load the .wasm from whatever path it's currently on.
loader/polyfills.ts:42
without any possibility to configure where the assemblies actually are; i.e. "./" instead of "./_framework/*"
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: