【问题标题】:Codemirror - Module parse failed: Unexpected tokenCodemirror - 模块解析失败:意外的令牌
【发布时间】:2019-03-22 04:05:54
【问题描述】:

我正在使用 react-codemirror2。我使用npx create-react-app appname 来创建我的应用程序。

但是当我尝试运行开发服务器时,它给了我以下错误 -

./node_modules/codemirror/mode/rpm/changes/index.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
> <!doctype html>
| 
| <title>CodeMirror: RPM changes mode</title>

一种解决方案建议更改 modulesDirectories。我尝试使用npm run eject 这样做。但没有成功。

请帮帮我

【问题讨论】:

标签: reactjs codemirror react-codemirror


【解决方案1】:

doctype 声明不正确,应该是:

<!DOCTYPE html>

注意 DOCTYPE 应该大写。

【讨论】:

猜你喜欢
  • 2019-02-15
  • 2023-03-27
  • 2021-04-26
  • 2021-05-01
  • 2020-11-16
  • 2021-05-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多