记录create-react-app使用craco-fast-refresh热更新插件,报错Uncaught TypeError: Cannot read properties of undefined (reading 'signature')

  • 记录create-react-app使用craco-fast-refresh热更新插件,报错Uncaught TypeError: Cannot read properties of undefined (reading 'signature')已关闭评论
  • 200 次浏览
  • A+
所属分类:Web前端
摘要

1.问题背景项目在引用自研组件库后,启动后webpack报错热更新存在问题,无法正常启动

1.问题背景

项目在引用自研组件库后,启动后webpack报错热更新存在问题,无法正常启动
记录create-react-app使用craco-fast-refresh热更新插件,报错Uncaught TypeError: Cannot read properties of undefined (reading 'signature')

2.解决方案

在询问组件库开发同事,被告知无问题;百度无果;查找webpack源码后,发现能定位到报错的代码位置,却无力解决时。我决定使用控制变量法,禁用热更新插件,来解决问题。幸运的是,还真就解决了,注释掉热更新组件后,组件能正常引入了。
记录create-react-app使用craco-fast-refresh热更新插件,报错Uncaught TypeError: Cannot read properties of undefined (reading 'signature')
记录create-react-app使用craco-fast-refresh热更新插件,报错Uncaught TypeError: Cannot read properties of undefined (reading 'signature')

3.结尾

目前此问题还不知道原因,只能去找找其他热更新插件是否可用了。