reactjs - Codemirror - 模块解析失败:意外的令牌
问题描述
我正在使用 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
. 但没有成功。
请帮助我
解决方案
doctype 声明不正确,应该是:
<!DOCTYPE html>
注意DOCTYPE应该大写。
推荐阅读
- python - 按字段值快速定位包含数据类列表的数据类中的项目
- android - LiveData-Fragment 或 Activity 的 lifeCycleOwner 应该是什么?
- javascript - 在用户早期创建的 ROW 中创建新字段
- r - 使用离散数据分析生物体生长模式
- node.js - Node.js 模拟 context.req.headers.referer
- php - php debug_backtrace 在 CodeIgniter4 中找不到当前文件
- cmake - 如何使用组件创建 cmake 项目
- javascript - Javascript内存分配:堆和栈
- c++ - 为什么访问已删除的指针不会使程序崩溃?
- typescript - 如何检查两个属性是否同时为真或假