react17安装html-react-parser运行报错记录

背景

react@17 安装 html-react-parser

powershell 复制代码
npm install html-react-parser

运行终端报错信息

powershell 复制代码
ERROR in ./node_modules/html-react-parser/esm/index.mjs 2:0-122 
Can't reexport the named export 'htmlToDOM' from non EcmaScript module (only default export is available)

原因

版本不匹配

react@17 安装 html-react-parser@3.0.9 亲测匹配

参考: https://github.com/peternewnham/react-html-parser/issues/84

相关推荐
一颗烂土豆17 小时前
Meshopt 压缩深度解析,为什么它比 Draco 更快
前端·javascript·webgl
YFF菲菲兔18 小时前
调度系统和调和系统的桥梁
react.js
kyriewen20 小时前
同事每天催我 Code Review,我写了个脚本让 AI 替我 review PR——现在他反过来催 AI 了
前端·javascript·ai编程
米丘1 天前
微前端之 Web Components 完全指南
微服务·html
weedsfly1 天前
迭代器、生成器与异步迭代——让数据“按需流动”的艺术
前端·javascript
YFF菲菲兔1 天前
commitRoot 源码解析
react.js
假如让我当三天老蒯1 天前
前端跨域解决方案(学习用)
前端·javascript·面试
铁皮饭盒1 天前
Bun 哪比 Node.js 快?
javascript·后端
JieE2121 天前
LeetCode 56. 合并区间|超清晰 JS 图解思路,面试高频区间题
javascript·算法·面试
candyTong1 天前
RTK 技术原理:一次典型会话里,80% 上下文是怎么省下来的
javascript·后端·架构