TypeError:this.html在Reactjs中未定义(renderHTML有问题)
我尝试创建一个引用github存储库的博客。当博客数量超过2个时,可以使用一个load more按钮来加载博客,我做到了。它在node_modules文件夹中显示了一个错误,我没有打开它。我试图清除缓存,但什么也没发生TypeError:this.html在Reactjs中未定义(renderHTML有问题),reactjs,frontend,next.js,mern,Reactjs,Frontend,Next.js,Mern,我尝试创建一个引用github存储库的博客。当博客数量超过2个时,可以使用一个load more按钮来加载博客,我做到了。它在node_modules文件夹中显示了一个错误,我没有打开它。我试图清除缓存,但什么也没发生 TypeError: this.html is undefined ./node_modules/parse5/lib/tokenizer/preprocessor.js/Preprocessor.prototype.write ./node_modules/parse5/l
TypeError: this.html is undefined
./node_modules/parse5/lib/tokenizer/preprocessor.js/Preprocessor.prototype.write
./node_modules/parse5/lib/tokenizer/preprocessor.js:91
88 | else
89 | this.html = chunk;
90 |
> 91 | this.lastCharPos = this.html.length - 1;
92 | this.endOfChunkHit = false;
93 | this.lastChunkWritten = isLastChunk;
94 | };
有人能提出解决办法吗
错误屏幕截图:[]
GitHub存储库链接:我解决了它。实际问题出现在renderHTMLnpm包中,因为它尚未更新,所以我尝试使用striptags,效果很好 所以基本上不是
{renderHTML(blog.extract)}
我使用了
{striptags(blog.extract)}
,效果很好尝试删除node_模块和package.json.lock,然后npm update
&npm install