我收到以下错误:
Unable to resolve type: React.ReactEnvironment
内部异常:
Unable to resolve type: React.JavaScriptEngineFactory
内部异常:
Object doesn't support this property or method
这是 Application_Start
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
这是 BundleConfig.RegisterBundles
bundles.Add(new BabelBundle("~/bundles").Include("~/Scripts/HelloWorld.jsx"));
这是主页/索引视图
@{
ViewBag.Title = "Index";
}
<script src="~/Scripts/react/react.min.js"></script>
<script src="~/Scripts/react/react-dom.min.js"></script>
@Scripts.Render("~/bundles")
<div id="content"></div>
错误发生在这一行
@Scripts.Render("~/bundles")
Update1 当我尝试直接在浏览器中访问 /Scripts/HelloWorld.jsx 时,我收到了以下服务器错误消息:
MsieJavaScriptEngine.JsRuntimeException: Object doesn't support this property or method