You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[browser] Assembly search path should be relative to the blazor.boot.json, not the importing module. #99539
When finding .wasm files in detect_features_and_polyfill, the scriptUrlQuery 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
Activity
ghost added
needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
changed the title [-]WASM: Assembly search path should be relative to the blazor.boot.json, not the importing module.[/-][+][browser] Assembly search path should be relative to the blazor.boot.json, not the importing module.[/+]on Apr 22, 2024
Activity
maraf commentedon Mar 13, 2024
You have several workarounds at the moment
<WasmRuntimeAssetsLocation>./</WasmRuntimeAssetsLocation>MSBuild property to skip putting wasm runtime assets to_frameworkfolder.We are looking into making the wasm app structure more bundler friendly. Inlining boot config or #86162 are one of the things
[-]WASM: Assembly search path should be relative to the blazor.boot.json, not the importing module.[/-][+][browser] Assembly search path should be relative to the blazor.boot.json, not the importing module.[/+]