Skip to content

Server-side rendering on Azure WebSite with importing 3rd party JS files. #198

@alekkowalczyk

Description

@alekkowalczyk

Hi!,

I'm using ReactJS.NET 2.1 in my latest project, everything locally works great, but I have a problem after publishing to an Azure WebSite.
I have a few React components, and I'm using React-bootstrap.js, everything in ASP.NET 5. That is how my Startup.cs looks like when it comes to configuring React for server-side rendering:

// Add ReactJS.NET to the request pipeline.
            app.UseReact(config =>
            {
                config
                    .AddScriptWithoutTransform("~/js/react-bootstrap.min.js")
                    .AddScript("~/app/navigation.jsx")
                    .AddScript("~/app/home.jsx")
                    .AddScript("~/app/accounts/accountUtils.js")
                    .AddScript("~/app/accounts/myAccounts.jsx");
            });

Works great locally on IIS Express, but after publishing on Azure WebSites I'm getting following exception on application stratup:

Error while loading "~/js/react-bootstrap.min.js": Object.create: implementation only accepts one parameter.

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