Skip to content

Unable to call JavaScript in onintialized, new Exception about not being allowed to call JS in static mode #64707

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] [regression]
After upgrading to Visual Studio version 10 I had Blazor apps fail when they ran ok on version 9. I would get an exception that jsruntime can't be called in oninitialized as it is in static mode and you can't use it until after render. In version 9 I could call Javascript to get info about the client browser for language, nationality and size. I used this info in the rendering mode. Now I have to get the info after render and re-render.


Original Comments

Feedback Bot on 12/9/2025, 10:00 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issueStatus: No Recent Activityarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions