New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] VFS/common WasmApp properties ignored in wasmbrowser template #99223
Comments
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionThere are a number of public properties listed in This means that there's no actual Setting The documentation for
|
I thought it was weird that the tests hadn't caught this or at least had warnings, it looks like the tests have a warning for this:
But the element isn't |
The As a work around you have two options dotnet.withConfig({ resources: { vfs: { "virtual_path_file_in_vfs.txt": { "relative_path_in_wwwroot_to_file.txt" : null } } } }) b. Revert back to previous SDK (it fully works in .NET 8, but will be removed in the future) |
Right, thanks, I was worried it might be something like that. Is there any info on what the plan is for the new SDK for these things (will VFS be used at all, how will we be able to add content to wwwroot from referenced projects, etc), or is it still being decided as things are developed? I can build something to work around it with the first option, I just don't want to end up with something that's completely incompatible with how it's meant to work in .NET 9 and later, if there's already info. |
Trying the workaround though, I still end up with runtime failures in JS: I could load Confirmed this works (looked it up in the advanced sample in dotnet/runtime):
|
Sorry, I missed that we are checking just presence of |
Description
There are a number of public properties listed in
WasmApp.Common.targets
(previouslyWasmApp.targets
) likeWasmFilesToIncludeInFileSystem
. However, at least in 8.0.2, the logic does not run even for a fresh project fromwasmbrowser
template. This seems to be because some properties/items are tied toWasmGenerateAppBundle
being true (which leads to_WasmGenerateAppBundle
running), but that is forced to false when_UsingBlazorOrWasmSdk
is true within the toolchain.This means that there's no actual
AppBundle
folder created, VFS isn't exposed at all so there's no apparent way to add files to it, and some other properties listed in the targets file don't seem to have an effect.Setting
WasmGenerateAppBundle
to true, or attempting to unset_UsingBlazorOrWasmSdk
, in the csproj does not work because these values are being set in the toolchain file.The documentation for
WasmGenerateAppBundle
at least seems to be wrong if this is intentional:But then also there's no exposed way to acccess VFS and a few other features, when it would be convenient to do so.
The documentation in
features.md
is also wrong then, as it listsAppBundle
as the folder and that is never created from the template, onlywwwroot
.Reproduction Steps
wasm-tools
andwasm-experimental
workloads (to have the templates, but that's not strictly required I think)wasmbrowser
templateExpected behavior
Target
_WasmGenerateAppBundle
is not skipped.Actual behavior
Target "_WasmGenerateAppBundle" skipped, due to false condition; ('$(WasmGenerateAppBundle)' == 'true') was evaluated as ('false' == 'true').
Regression?
No response
Known Workarounds
Injecting a target that runs as part of the toolchain or at least early enough in the WASM workflow, which sets
WasmGenerateAppBundle
works.For VFS specifically, I understand there might be some way to provide a custom
MonoConfig
in JS to set a list of assets. I haven't been able to get that working because of errors during the build, which seem to be tied to the MSBuild targets expectingWasmAppBuilder
to have run (which it doesn't).Configuration
.NET 8
Browser WASM
Other information
No response
The text was updated successfully, but these errors were encountered: