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

相关推荐
quweiie20 分钟前
thinkphp8+layui多图上传,带删除\排序功能
前端·javascript·layui
闲蛋小超人笑嘻嘻29 分钟前
树形结构渲染 + 选择(Vue3 + ElementPlus)
前端·javascript·vue.js
巴博尔1 小时前
uniapp的IOS中首次进入,无网络问题
前端·javascript·ios·uni-app
焚 城1 小时前
UniApp 实现双语功能
javascript·vue.js·uni-app
被巨款砸中2 小时前
前端 20 个零依赖浏览器原生 API 实战清单
前端·javascript·vue.js·web
文韬_武略2 小时前
web vue之状态管理Pinia
前端·javascript·vue.js
董世昌412 小时前
js怎样改变元素的内容、属性、样式?
开发语言·javascript·ecmascript
mosen8682 小时前
【Vue】Vue Router4x关于router-view,transtion,keepalive嵌套写法报错
前端·javascript·vue.js
蓝婴天使3 小时前
基于 React + Go + PostgreSQL + Redis 的管理系统开发框架
react.js·postgresql·golang
鸠摩智首席音效师3 小时前
如何清除 Yarn 缓存 ?
javascript