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

Getting FLXW01 on overriding OnInitializedAsync even though base is called. #522

Closed
Rhywden opened this issue Jan 4, 2025 · 2 comments
Closed
Milestone

Comments

@Rhywden
Copy link

Rhywden commented Jan 4, 2025

Basically, whenever I'm currently using an override for OnItializedAsync I'm getting

FLXW01: Overriding OnInitialized or OnInitializedAsync without calling base is not allowed

even when the function looks like this:

protected override Task OnInitializedAsync()
{
    return base.OnInitializedAsync();
}

Also doesn't seem to be an actual problem because the whole thing compiles and runs anyway.

@wbaldoumas
Copy link

I'm observing this issue as well. It looks like it was introduced with release v6.2.1.5. I'm not able to replicate the problem if I downgrade to v6.1.0.

The suggested fix from @trinks-slam818 above points to a possible work around as well.

The issue happens when returning base.OnInitializedAsync() from the override:

protected override Task OnInitializedAsync()
{
    // Causes FLXW01 issue
    return base.OnInitializedAsync();
}

But not if it's awaited:

protected override async Task OnInitializedAsync()
{
    // This works fine
    await base.OnInitializedAsync();
}

@mrpmorris mrpmorris added this to the 6.5.2 milestone Jan 7, 2025
@mrpmorris
Copy link
Owner

Fixed in 6.5.2.

Thanks for the short + clear report!

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

No branches or pull requests

4 participants
@Rhywden @mrpmorris @wbaldoumas and others