当前位置: 首页 > news >正文

使用js-enumerate报错Cannot set properties of undefined

环境

  • node v16.20.2
  • react 18.3.1
  • react-scripts 5.0.1

按照最新 npx create-react-app my-app 创建出来的新项目,引入 js-enumerate 库后运行报错。

报错

  Uncaught runtime errors:ERROR
Cannot set properties of undefined (setting 'Enum')
TypeError: Cannot set properties of undefined (setting 'Enum')at http://localhost:3000/static/js/bundle.js:106620:201at ./node_modules/js-enumerate/dist/index.js (http://localhost:3000/static/js/bundle.js:106621:2)at options.factory (http://localhost:3000/static/js/bundle.js:108518:31)at __webpack_require__ (http://localhost:3000/static/js/bundle.js:107925:32)at fn (http://localhost:3000/static/js/bundle.js:108177:21)at ./src/index.js (http://localhost:3000/static/js/bundle.js:556:70)at options.factory (http://localhost:3000/static/js/bundle.js:108518:31)at __webpack_require__ (http://localhost:3000/static/js/bundle.js:107925:32)at http://localhost:3000/static/js/bundle.js:109097:37at http://localhost:3000/static/js/bundle.js:109099:12

解决方法

react-scripts5.0.1 降级到 4.0.3 ,项目正常运行。


http://www.mrgr.cn/news/58638.html

相关文章:

  • 【C#】使用Visual Studio创建Windows Forms应用程序计算对角线之和
  • 论文速读:YOLO-G,用于跨域目标检测的改进YOLO(Plos One 2023)
  • 若依框架的简单使用
  • Python:背景知识及环境安装
  • 纯css实现瀑布流! 附源码!!!
  • C++20中头文件source_location的使用
  • 前端零基础入门到上班:【Day4】HTML 多媒体与表单深度教程
  • 创建型模式-----建造者模式
  • 为什么磁链的基准值ψB=UB*tB
  • 用人工智能,应该怎么掏钱?
  • frida脚本,自动化寻址JNI方法
  • 【C++】一文带你深入理解C++异常机制
  • 7款视频转换器大测评!哪款是最适合你的视频格式转换器?
  • 现代Web界面交互新利器!来探一探这个魔法组件库——MagicUI
  • python 访问openai assistant api(一)
  • 金融工程--pine-script 入门
  • 【python实战】利用代理ip爬取Alibaba海外版数据
  • 从视频中学习的SeeDo:通过VLM解释视频并生成规划、代码(含通过RGB视频模仿的人形机器人OKAMI、DexMV)
  • 机器学习与神经网络的当下与未来
  • Vue学习记录之二十一 Vue3中3种编程风格介绍
  • 凯伦股份荣获中国钢结构协会2024年度技术创新奖
  • 第二单元历年真题整理
  • 文本预处理——构建词云
  • Matlab学习02-matlab中的数据显示格式及符号变量
  • AIGC底层技术揭秘
  • 揭开C++ STL的神秘面纱之string:提升编程效率的秘密武器