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

相关推荐
LuciferHuang1 小时前
震惊!三万star开源项目竟有致命Bug?
前端·javascript·debug
GISer_Jing1 小时前
前端实习总结——案例与大纲
前端·javascript
姑苏洛言2 小时前
编写产品需求文档:黄历日历小程序
前端·javascript·后端
知识分享小能手3 小时前
Vue3 学习教程,从入门到精通,使用 VSCode 开发 Vue3 的详细指南(3)
前端·javascript·vue.js·学习·前端框架·vue·vue3
姑苏洛言3 小时前
搭建一款结合传统黄历功能的日历小程序
前端·javascript·后端
hackchen3 小时前
Go与JS无缝协作:Goja引擎实战之错误处理最佳实践
开发语言·javascript·golang
你的人类朋友4 小时前
🤔什么时候用BFF架构?
前端·javascript·后端
知识分享小能手4 小时前
Bootstrap 5学习教程,从入门到精通,Bootstrap 5 表单验证语法知识点及案例代码(34)
前端·javascript·学习·typescript·bootstrap·html·css3
前端小趴菜055 小时前
react状态管理库 - zustand
前端·react.js·前端框架
我命由我123456 小时前
前端开发问题:SyntaxError: “undefined“ is not valid JSON
开发语言·前端·javascript·vue.js·json·ecmascript·js