Codemirror - 模块解析失败:意外的令牌

问题描述 投票:0回答:1

我正在使用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个回答
0
投票

doctype声明不正确,应该是:

<!DOCTYPE html>

注意DOCTYPE应该是大写的。

© www.soinside.com 2019 - 2024. All rights reserved.