javascript - ReactJS can't import 'react-router-dom' anymore
问题描述
A few days ago I just worked fine on my website, and could use the following syntax:
'import { BrowserRouter as Router, Route, Link } from "react-router-dom";'
in my program.
But today, when I wanted to go on with programming my website I got the following errors in console: https://pastebin.com/FXqKAyzd
This is odd tho because it worked just fine a few days ago. So I thought, maybe there was an update, and I updated 'react-router' and 'react-router-dom' to the newest version (at the time being: '5.0.0'). I hope someone can tell me, how to fix this, and why it says import Router from "react-router/es/undefined"
<- undefined
? and what the support for the latter
is?
解决方案
所以我只是解决了这个问题。或者更好地说:我的笔记本电脑做到了。我在我的笔记本电脑上提取了最后的更改,执行了“npm install”,它在 package-lock.json 中添加了一行代码
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true, //this one here
"requires": {
"brace-expansion": "^1.1.7"
}
然后我推了它,又把它拉到了电脑上,瞧,它又工作了。这让我有点困惑,但没关系。顺便说一句:由于@Vikas Singh,我尝试了很多谢谢!
推荐阅读
- javascript - 语音识别 API。Speechend 事件和 Speechstart 无法正常工作。特别是speechend
- confluence - 组织在一个部门下运行的所有项目所需的建议
- google-sheets - 如何应用基于其他 Google Work Book 值的条件格式?
- angular - RecordRTC 录制取消
- android - 是否可以使用 onselectChanged 在颤振中删除数据表的特定行?如果是,请提供示例代码
- apache-spark - Spark - 如果数据框中的日期有多个时间戳可用,则按时间戳降序排列
- azure - 能否强制 Azure 存储防火墙允许没有 VNET 的 Azure 应用服务?
- android - 如何在 Android 中正确使用 ViewModel?
- c# - 如何在roslyn分析器中获取一个类的所有接口
- .net-core - 使用 Prevoir.Api.Personne.Example .net core web Api 3.1 使用 IMultipleExamplesProvider 生成多个示例