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

相关推荐
GISer_Jing33 分钟前
Three.js着色器编译机制深度解析
javascript·webgl·着色器
丷丩35 分钟前
MapLibre GL JS第22课:查看本地GeoJSON
前端·javascript·map·mapbox·maplibre gl js
油炸自行车1 小时前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
ZC跨境爬虫4 小时前
跟着 MDN 学CSS day_29:(掌握文本与字体样式的核心艺术)
前端·css·ui·html·tensorflow
丷丩5 小时前
MapLibre GL JS第19课:实时更新要素
前端·javascript·gis·map·mapbox·maplibre gl js
xiaohua0708day6 小时前
Lodash库
前端·javascript·vue.js
突然好热6 小时前
TS 调试技巧
前端·javascript·typescript
h64648564h6 小时前
Flutter 国际化(i18n)全指南:一键切换中/英/日多语言
前端·javascript·flutter
丷丩7 小时前
MapLibre GL JS第8课:禁用滚动缩放
javascript·mapbox·maplibre gl js
kyriewen9 小时前
面试8家前端岗位后,我发现了一个残酷的事实:AI不是加分项,是门槛
前端·javascript·面试