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

[Bug]: MissingMethodException on EnsureSuccessfulAsync on WASM #1918

Open
alexdrl opened this issue Nov 7, 2024 · 2 comments
Open

[Bug]: MissingMethodException on EnsureSuccessfulAsync on WASM #1918

alexdrl opened this issue Nov 7, 2024 · 2 comments
Labels

Comments

@alexdrl
Copy link

alexdrl commented Nov 7, 2024

Describe the bug 🐞

Getting this error on a .NET 8 Blazor Web App, when render mode gets to WASM.

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Method not found: System.Threading.Tasks.Task1<Refit.ApiResponse1<!0>> Refit.ApiResponse1.EnsureSuccessfulAsync() System.MissingMethodException: Method not found: System.Threading.Tasks.Task1<Refit.ApiResponse1<!0>> Refit.ApiResponse1.EnsureSuccessfulAsync()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[d__14](d__14& stateMachine)

Step to reproduce

  1. Create sample project with .NET 8 Blazor
  2. Add Refit reference to WeatherForecast
  3. Call API and ask for EnsureSuccessfulAsync
  4. See error

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

Method should be present and request being verified

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

Refit Version

No response

Additional information ℹ️

No response

@alexdrl alexdrl added the bug label Nov 7, 2024
@PTLMatija
Copy link

PTLMatija commented Nov 14, 2024

We are experiencing a similar issue, while building a request. It does work on some machines but not on the others. Presumably the issue is on Windows10, Windows 11 works ok.

System.MissingMethodException: Attempted to access a missing method.
   at Refit.SystemTextJsonContentSerializer.ToHttpContent[T](T item)
   at Refit.RequestBuilderImplementation.AddBodyToRequest(RestMethodInfoInternal restMethod, Object param, HttpRequestMessage ret) in c:\temp\releaser\refit\Refit\RequestBuilderImplementation.cs:line 888
   at Refit.RequestBuilderImplementation.<>c__DisplayClass19_0.<BuildRequestFactoryForMethod>b__0(Object[] paramList) in c:\temp\releaser\refit\Refit\RequestBuilderImplementation.cs:line 683
   at Refit.RequestBuilderImplementation.<>c__DisplayClass15_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d.MoveNext() in c:\temp\releaser\refit\Refit\RequestBuilderImplementation.cs:line 320
--- End of stack trace from previous location ---

@TimothyMakkison
Copy link
Contributor

Hey, does this issue persist when you downgrade refit versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants