我是React世界的新手,在使用npm升级所有组件后(例如,反应15到16),我开始遇到问题:

多反应中的错误 - hot-loader / patch event-source-polyfill webpack-hot-> middleware / client?path = __ webpack_hmr&dynamicPublicPath = true ./ClientApp/boot.tsx找不到模块:错误:无法解决'反应 - hot-loader / webpack'in>'C:\ Users \ Catinodeh \ Documents \ Visual Studio 2017 \ Projects \ NEWEN \ Master \ NEWEN.Web'@ multi react-hot-loader / patch event-source-polyfill webpack-hot- > middleware / client?path = __ webpack_hmr&dynamicPublicPath = true ./ClientApp/boot.tsx

我可以看到我的索引页面加载在后面但弹出一个显示此错误的模态 .

我正在使用装载机V3,因为我更新了所有包(这是一个新项目),它进入了V4 . 我跟着these instructions,当他说要卸载webpack时,我删除了(使用Visual Studio)我的"npm"节点中没有"@type"之前的加载器 .

这就是我的boot.tsx目前的样子:

import './css/site.css';
import 'bootstrap';
import * as React from "react";
import * as ReactDOM from 'react-dom';
import { hot } from "react-hot-loader";
import { BrowserRouter } from "react-router-dom";
import * as RoutesModule from "./routes";
let routes = RoutesModule.routes;

const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href')!;

ReactDOM.render(<BrowserRouter children={routes} basename={baseUrl} />, document.getElementById('root'));

我究竟做错了什么?