Skip to content
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

MudBlazor on MacOS arm64 does not recognize tags resulting in RZ10012 in many places #9881

Closed
petrhank opened this issue Jan 30, 2024 · 57 comments
Assignees
Labels
bug Something isn't working vscode

Comments

@petrhank
Copy link

Type: Bug

Issue Description

When trying to work on our Blazor WASM project in VS Code, I get RZ10012 error highlited on every custom component in Razor pages. It could do something with LSP, because when I select "Use Omnisharp" in C# extension settings, the problem goes away.
It works as expected in every other IDE.

Logs

extensions log.zip

Environment information

VSCode version: 1.85.2
C# Extension: 2.15.30
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.8d38d0cc

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
Workload version: 8.0.100-manifests.8d38d0cc
[wasm-tools-net6]
Installation Source: VS 17.8.34322.80
Manifest Version: 8.0.0/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net6\8.0.0\WorkloadManifest.json
Install Type: Msi

[wasm-tools]
Installation Source: VS 17.8.34322.80
Manifest Version: 8.0.0/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: VS 17.8.34322.80
Manifest Version: 8.0.3/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: VS 17.8.34322.80
Manifest Version: 17.0.8478/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: VS 17.8.34322.80
Manifest Version: 17.0.8478/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json
Install Type: Msi

[android]
Installation Source: VS 17.8.34322.80
Manifest Version: 34.0.43/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json
Install Type: Msi

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
blazorwasm-companion ms-dotnettools 1.1.4 ms-dotnettools.blazorwasm-companion-1.1.4
csdevkit ms-dotnettools 1.2.7 ms-dotnettools.csdevkit-1.2.7-win32-x64
csharp ms-dotnettools 2.15.30 ms-dotnettools.csharp-2.15.30-win32-x64
vscode-dotnet-runtime ms-dotnettools 2.0.1 ms-dotnettools.vscode-dotnet-runtime-2.0.1
vscode-open-multiple-files fabiospampinato 1.4.0 fabiospampinato.vscode-open-multiple-files-1.4.0
vscode-solution-explorer fernandoescolar 0.8.5 fernandoescolar.vscode-solution-explorer-0.8.5
vscodeintellicode-csharp ms-dotnettools 0.1.26 ms-dotnettools.vscodeintellicode-csharp-0.1.26-win32-x64

Extension version: 2.15.30
VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:10.514Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 3700X 8-Core Processor (16 x 3593)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.93GB (1.36GB free)
Process Argv . --crash-reporter-id 2a60ca11-95f2-43ae-8dd5-6f5bd810ef7b
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
0bi6i642:30951795
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementst:30887150
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
dsvsc019a:30951918
7j2b6412:30949929

@dibarbet dibarbet transferred this issue from dotnet/vscode-csharp Jan 30, 2024
@ghost ghost added the untriaged label Jan 30, 2024
@phil-allen-msft phil-allen-msft added this to the 17.10 Planning milestone Feb 1, 2024
@ghost ghost removed the untriaged label Feb 1, 2024
@ryzngard
Copy link
Contributor

ryzngard commented Feb 6, 2024

Thanks @petrhank . When you say custom components, are they contained within a separate project or the same project? If possible, can you share a sample solution?

@mikes-gh
Copy link

mikes-gh commented Feb 17, 2024

@ryzngard I have the same issue. I have to use omnisharp to have a usable problems pane.
You can repo by

  1. git clone https://github.com/MudBlazor/MudBlazor.git
  2. Open the project.
  3. Observe hundreds of RZ10012 warnings.

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Please see our Issue Management Policies for more information.

@mikes-gh
Copy link

@ryzngard bump to keep issue open

@ryzngard
Copy link
Contributor

Thanks @mikes-gh , I'll take the needs more info label off so I can verify the repro

@ryzngard
Copy link
Contributor

@mikes-gh I was able to reproduce this at startup, but it eventually went away as project information populated. I'm using the following versions:

C#: v2.18.16
C# Dev Kit: v1.3.10
Windows: 10.0.22631

Essentially at startup I would see the "Problems" fluctuate from 0 to 1k+ over and over again, but as the project loaded, nuget restore happened, and builds happened, eventually I got to a steady state. I was verifying by opening MudAppBar.razor

Let me know if this matches your experience, if you have more details on what to check, or if the configuration is different than yours.

@mikes-gh
Copy link

mikes-gh commented Feb 27, 2024

Yes, it takes a very long time and doesn't always reliably finish.
I have a MacBook pro M2 so CPU is not an issue.
I am often left with warnings and errors and every time I open a new razor file the analysers start again. Sometimes warning disappear and sometimes they reappear. I am not exaggerating when I say it is unusable.

Heres my current problems page on MudBlazor that has been open all night.

image

There are no compile warnings

@mikes-gh
Copy link

I do have full solution analysis on

image

@mikes-gh
Copy link

@ryzngard I see this has gone stale. Is there anything else you need.

@ryzngard
Copy link
Contributor

ryzngard commented Mar 16, 2024

Thanks for the ping @mikes-gh. I believe this issue has been resolved and not shipped, so I'm waiting for our next version of the C# extension to verify it's resolved. Testing locally from dotnet/vscode-csharp resolved the issue for me. #10007 is the issue that was fixed, and I believe MudBlazor projects would suffer heavily.

Once we have shipped I'll check in with you to see if it's resolved before closing.

@mikes-gh
Copy link

OK great. I did some extension authoring a while back so I'll see if I can run the extension from source. What branch would it be.

@ryzngard
Copy link
Contributor

You can check main for https://github.com/dotnet/vscode-csharp . It should be straight forward, but make sure you're using node v18. The steps are roughly below

  1. npm i
  2. npx gulp installDependencies
  3. code .
  4. f5 to run extension

@mikes-gh
Copy link

Thanks @ryzngard will 20.11.1 LTS be ok

@ryzngard
Copy link
Contributor

Unfortunately not. There's a known issue about that

@Jad-EL
Copy link

Jad-EL commented Mar 19, 2024

Hi !

I'm facing the same issue with vscode, on a blazor project using mudblazor as well. I have more than 800 "problems" / warnings on razor files (RZ10012, CS0013)

But enabling Omnisharp doesn't fix my case.

I just can't develop with vscode anymore for now, obliged to switch back to Visual Studio.

Do you guys know if there is a workaround ?

@mikes-gh
Copy link

mikes-gh commented Mar 19, 2024

Hi !

I'm facing the same issue with vscode, on a blazor project using mudblazor as well. I have more than 800 "problems" / warnings on razor files (RZ10012, CS0013)

But enabling Omnisharp doesn't fix my case.

I just can't develop with vscode anymore for now, obliged to switch back to Visual Studio.

Do you guys know if there is a workaround ?

You have to disable C# Dev Kit in order for OmniSharp to work after changing the setting.

Hope this helps

@Jad-EL
Copy link

Jad-EL commented Mar 19, 2024

Hi !
I'm facing the same issue with vscode, on a blazor project using mudblazor as well. I have more than 800 "problems" / warnings on razor files (RZ10012, CS0013)
But enabling Omnisharp doesn't fix my case.
I just can't develop with vscode anymore for now, obliged to switch back to Visual Studio.
Do you guys know if there is a workaround ?

You have to disable C# Dev Kit in order for OmniSharp to work after changing the setting.

Hope this helps

Yep, it's better, thanks a lot !

@ryzngard
Copy link
Contributor

@mikes-gh version 2.22.5 shipped and should contain the fix.

@mikes-gh
Copy link

mikes-gh commented Mar 20, 2024

@ryzngard
Sorry to report I see no change using the latest C# Extensions.

I have
C# v2.22.5 release version
C# Dev Kit v1.4.29 release version

@vudzero
Copy link

vudzero commented Mar 20, 2024

I do have the exact same issue, very small project. Compiles and run fines. No warning flags in Rider.

image

c#: v2.23.2 (pre-release)
VSCode: 1.87.2
MacOS: Sonoma 14.1.2

@ryzngard
Copy link
Contributor

@ryzngard Sorry to report I see no change using the latest C# Extensions.

I have C# v2.22.5 release version C# Dev Kit v1.4.29 release version

Thank you for testing! I'll take a look sometime this week on my mac and see if I can get the current repro. I wasn't able to immediately get a local repro with the latest so it will take a bit more digging.

@ryzngard
Copy link
Contributor

Ah, please file a separate issue for windows. With a repro if you have it and can share

@mikes-gh
Copy link

Ah, please file a separate issue for windows. With a repro if you have it and can share

@ryzngard this issue was filed under windows. Maybe this is a cross platform issue?

@ryzngard
Copy link
Contributor

@mikes-gh it's been an unfortunate set of issues that result in similar behavior, but all root caused differently. Right now I'm using this to track the mac OS issue with the mudblazor project.

@ryzngard
Copy link
Contributor

I'll update the title, but I spent time this afternoon debugging. I hit a few issues with building the razor repo on mac arm, so added some fixes there.

I noticed after a while the c# code eventually works. One key thing to look for is the presence of a project.razor.vscode.bin file in the obj folder. I wasn't getting that before, so we're making progress. I'm still seeing errors in our own project mapping: asking for details in a razor document results in us trying to find it and going into the fallback/misc project. That explains no tags being found because that project doesn't have the necessary hookup for imports etc.

I'll continue to dig into this time permitting, but wanted to give a short update. As of now for the repro I have MudBlazor functions on Windows but not MacOS. I may do a sanity check on linux over the weekend to see if it might have a related issue.

@ryzngard ryzngard changed the title Blazor WASM / razor page: "RZ10012: Found markup element with unexpected name ..." error, when using Language Server Protocol. MudBlazor on MacOS arm64 does not recognize tags resulting in RZ10012 in many places Apr 19, 2024
@ryzngard
Copy link
Contributor

Note that with devkit installed I was able to get rid of the errors after waiting about 30s, which may indicate a c# project system bug with communicating with razor. This is with

c# v2.26.13 (pre-release)
devkit v1.4.29
image

@mikes-gh
Copy link

@ryzngard Is there anything I can do testing wise to help?

@mikes-gh
Copy link

@ryzngard

Still same problem using
C# extension v2.31.19
C# devkit v1.7.22 (pre-release)

Staying on Omnisharp

@ryzngard
Copy link
Contributor

@mikes-gh we definitely still have issues here, and a larger architecture change happening that will reduce problems in this area. That said, I'm still looking for ways to make targeted fixes. Thank you for your diligence reporting and patience 🙏

@Jad-EL
Copy link

Jad-EL commented Jun 13, 2024

@mikes-gh it's been an unfortunate set of issues that result in similar behavior, but all root caused differently. Right now I'm using this to track the mac OS issue with the mudblazor project.

@ryzngard Should I open a ticket for Windows, reporting the same issue ?

@ryzngard
Copy link
Contributor

@Jad-EL yes, with a repro project if you can.

@Jad-EL
Copy link

Jad-EL commented Jun 13, 2024

Unfortunately It's hard to repro because the issue only occurs with big projects, when there is a lot of components inside. But I will create the ticket anyway.

Thanks for your work.

@bviala
Copy link

bviala commented Jul 15, 2024

Working on a Blazor WASM with MudBlazor, on a macOS arm64.
I did not experience any issue with MudBlazor components, however I did have this RZ10012 bug for my own components.

I found that if I create a new .razor file in the same folder than the non resolved component, it fixes the issue :)

@ryzngard
Copy link
Contributor

Reliability should be resolved with v2.39.28 (pre-release). It takes multiple minutes on my mac but the MudBlazor solution loads and gets tags recognized. Will be tracking performance with improvements with #10600

I tested multiple times with different projects and after "settling" things were reliably working. If you are still hitting issues please let me know and I'll reopen.

Thanks everyone for your input!

@mikes-gh
Copy link

mikes-gh commented Aug 3, 2024

@ryzngard For me its not fixed.
Do I need to clean obj and bin maybe?

Using head of MudBlazor
C# v2.41.26 (pre-release)
Dev Kit v1.9.53 (pre-release)

After opening a few files all problems disappear.
However, no formatting hints (info's).

As if the analysers just stopped working.

@ryzngard
Copy link
Contributor

ryzngard commented Aug 4, 2024

@mikes-gh just to double check, Mac arm64?

Cleaning out bin / obj should no longer change anything but it's always worth a try. If opening files fixes it I believe we have a separate issue for that. I'm currently on holiday though so and don't have the easiest way to find it.

Definitely let me know if anything else ends up resolving the issue!

If you're reliably seeing issues filing a new feedback might get more traction. Especially if opening files fixes because that seems to be a different root cause.

@mikes-gh
Copy link

mikes-gh commented Aug 5, 2024

@ryzngard Unfortunately whilst opening files does cause more analysis RZ10012 remains even after leaving the solution open for many minutes. This is using Mac arm64.
For me this issue is not solved.

@mikes-gh
Copy link

mikes-gh commented Aug 5, 2024

Perhaps you have a repro where it works so I can follow step by step.

@tn-5
Copy link

tn-5 commented Aug 6, 2024

I've consistently experience the same issue on MacOS arm. Attached a minimum repo with a blazor project with class library.

It looks like it is dependent on the number of components declared in the library, in this sample there are 20 components in lib1/components

The symptoms start after the plugin reports an error of the type:
StreamJsonRpc.RemoteInvocationException: Request nominateProject failed with message: Cannot read properties of undefined (reading 'size')

See err.txt in the project for samples of this error.

RZ10012 _btest1.zip

@ryzngard
Copy link
Contributor

ryzngard commented Aug 6, 2024

Perhaps you have a repro where it works so I can follow step by step.

I was testing with MudBlazor on latest dev.

@tn-5 that looks like an issue with C# Dev Kit based on the stack

8/6/2024 7:35:40 AM
LimitedFunctionality
StreamJsonRpc.RemoteInvocationException: Request nominateProject failed with message: Cannot read properties of undefined (reading 'size')
   at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
   at Microsoft.VisualStudio.ProjectSystem.PackageReferences.NuGetRestoreService.NominateAsync(ProjectRestoreInfo restoreData, IReadOnlyCollection`1 inputVersions, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.PackageReferences.NuGetRestoreService.NominateAsync(ProjectRestoreInfo restoreData, IReadOnlyCollection`1 inputVersions, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.PackageRestore.PackageRestoreDataSource.NominateForRestoreAsync(ProjectRestoreInfo restoreInfo, IReadOnlyCollection`1 versions, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.PackageRestore.PackageRestoreDataSource.RestoreCoreAsync(PackageRestoreUnconfiguredInput value)
   at Microsoft.VisualStudio.ProjectSystem.PackageRestore.PackageRestoreDataSource.RestoreAsync(IProjectVersionedValue`1 e)
   at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformManyBlockSlimAsync.ProcessInputAsync(TInput input)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.ProcessInputQueueAsync(InputDataBuffer inputQueue)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.ProcessInputQueueAsync(InputDataBuffer inputQueue)
===================

I would file a new issue using CSharp: report an issue to get it routed correctly.

@tn-5
Copy link

tn-5 commented Aug 6, 2024

@ryzngard On Windows 11 / arm I get the same RZ10012 error on components with the sample project. On that platform it does not give the dev kit exception though - just the RZ10012 warning.

@mikes-gh
Copy link

mikes-gh commented Aug 6, 2024

@ryzngard I also see the same issue on codespaces (Linux?)
I believe this eliminates my environment.

The issue is this one that is now closed.
Even though the warnings may eventually go to zero sometimes. Opening a file causes the problem again with RZ10012 which does not go away even after leaving the IDE to settle down.

@ryzngard
Copy link
Contributor

ryzngard commented Aug 6, 2024

Thanks @mikes-gh for checking. I'll take a look soon. It happening in codespaces is helpful information

@pandapknaepel
Copy link

We can't load our large blazor project either. This is very sad since Microsoft dropped support for vs for Mac.

The errors don't disappear also after more than 10 minutes waiting.

@ryzngard
Copy link
Contributor

On my mac with

dotnet sdk 8.0.400
C# v2.40.27
C# Dev Kit v1.9.55
MudBlazor commit 91e948f571e01f0e6bacfeb6e02816c4f6b178b4

I was able to get MudBlazor components loaded. This happened relatively fast (within about 2 minutes) on my M1 Max

I did notice that MudBlazor.Docs took a bit longer to work. I also hit #10654 which I'll be investigating next.

#10600 is being used to find ways to improve perf here.

Testing in codespaces it looks like the init never gets sent from the extension, so server setup never happened. That seems to be a completely different issue #10735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vscode
Projects
None yet
Development

No branches or pull requests