webpack4.x 升级react-router v4 发现history 冲突
Author:[email protected] Date:
Uncaught Error: You have provided a history object created with history v4.x or v2.x and earlier. This version of React Router is only compatible with v3 history objects. Please change to history v3.x.
突然跑不动了,
const history = createHashHistory({ basename: '', // The base URL of the app (see below) hashType: 'slash', // The hash type to use (see below) // A function to use to confirm navigation with the user (see below) getUserConfirmation: (message, callback) => callback(window.confirm(message)) });
整个是来自官方的demo 还是跑不通。坑爹啊
然后,history有2.x 3.x 4.x 等几个版本,各个都不兼容。react-router 2.x 3.x 兼容,4.x 不兼容。
npm i -D [email protected]
转载本站文章《webpack4.x 升级react-router v4 发现history 冲突》,
请注明出处:https://www.zhoulujun.cn/html/tools/Bundler/webpack/2016_0217_6209.html
上一篇:第一页
延伸阅读:
- webpack外网访问设置—webpack-dev-server配置及跨域解决
- webpack编译sass,缺少vendor, node-sass报 vendor错误
- webpack css背景图片无法现实,图片路径404
- webpack scripts copyfiles copy图片至dist目录
- webpack一直报Invalid Host header
- webpack执行终端shell命令操作系统:webpack-shell-plugin
- webpack4循环依赖:UnhandledPromiseRejectionWarning: Error: Cyclic dependency
- vue-cli导出webpack配置给webstorm/intellij,从而智能提示
- UglifyJs配合webpack打包报Unexpected token: keyword const
- webpack抽离css,mini-css-extract-plugin Conflicting order
- webpack打包之文件Gzip压缩与Brotli压缩配置
- webpack配置devServer配置https代理与证书
- webpack打包发布npm包优化-vue/echarts等公共库抽离
- webpack打包npm组件库,libraryTarget如何选择?
- webpack 开环境 资源查看webpack-DEV-SERVER
- webpack动态路径:__webpack_public_path__作用
- webpack5升级总结:在weppack5.1x升5.7x所遇到的问题汇总
- webpack4.x 与react-router2.x冲突,报错
- DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` inste
- dart-sass替代node-sass区别:fix Node Sass一切问题(系统不支持/gyp