Skip to content

Unhandled Rejection (Error): Dynamic root components have not been enabled in this application. #377

@frankrem

Description

@frankrem

Reproduce on MacOS

cd samples/aspnetcore/blazor/JSComponentGeneration/JSComponentGeneration.Build
dotnet build
cd ../BlazorAppGeneratingJSComponents
dotnet watch

From another prompt:

cd samples/aspnetcore/blazor/JSComponentGeneration/react-app-with-blazor
export NODE_OPTIONS=--openssl-legacy-provider
npm run start

Browse to http://localhost:3000 and click button Add Blazor counter.

The browser displays: Unhandled Rejection (Error): Dynamic root components have not been enabled in this application..

The offending code seems to be in react-app-with-blazor/src/blazor-react.js on line 32:

return Blazor.rootComponents.add(parentElement, `${identifier}-react`, props);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions