我收到以下錯誤:如何解決無法解析類型:React.ReactEnvironment異常
Unable to resolve type: React.ReactEnvironment
的InnerException:
Unable to resolve type: React.JavaScriptEngineFactory
的InnerException:
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 當我試圖出現錯誤直接在t中訪問/Scripts/HelloWorld.jsx他的瀏覽器我得到這個服務器錯誤消息:
MsieJavaScriptEngine.JsRuntimeException: Object doesn't support this property or method
盡我更新的答案 – CPR43
沒有奏效。 –