samples icon indicating copy to clipboard operation
samples copied to clipboard

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

Open frankrem opened this issue 1 year ago • 0 comments

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);

frankrem avatar Apr 13 '24 16:04 frankrem