I just published an application that is working fine in development, but when I upload it to the server it fails when I try to pre-render a specific view.
Simple mvc function returning a view:
public ActionResult StandaloneReport(ReportPageData pageData)
{
return View(pageData);
}
Simple server side render:
@Html.React("Components.ReportDisplayContainer", new {.pageData = Model})
@Html.ReactInitJavaScript()
React.net is set to used a pre-packed js bundle:
ReactSiteConfiguration.Configuration.SetLoadBabel(false)
.AddScriptWithoutTransform("~/Scripts/webpack/build/server.bundle.js");
ReactSiteConfiguration.Configuration.SetReuseJavaScriptEngines(false);
This all works fine in development, and I have republished and deleted all files from the server before publishing so I don't get why it's not working on the server..
The error I am getting is:
Error while rendering "Components.ReportDisplayContainer" to "react_phCzHNkR5Uq7r5UEzzqYrQ": Script threw an exception: Object doesn't support property or method 'from' Line: 0 Column:0
Line 61: @Html.React("Components.ReportDisplayContainer", New With {.pageData = Model})
Which I can only see relates to this line of code generated by webpack:
return Array.from(arr);
So why is the react helper happy to do it locally but not on the server?