升级jquery-ui与gridstack后React生产环境出现TypeError问题求助
依赖升级后生产环境出现TypeError问题排查
近期在React应用中完成以下依赖升级:
- jquery-ui 从1.12.1版本升级至1.13.2版本
- gridstack 从0.4.0版本升级至7.1.1版本
应用在本地环境运行正常,但生产环境无法正常工作,浏览器中出现如下错误:
Potentially unhandled rejection [3] TypeError: Cannot read properties of undefined (reading 'prototype') at eval (https://myapp.com/bundles/app-loader.js:3:12720232) at Function.eval (https://myapp.com/bundles/app-loader.js:3:12729741) at execute (https://myapp.com/steal-with-promises.production.js:12:53460) at h (https://myapp.com/steal-with-promises.production.js:12:43416) at h (https://myapp.com/steal-with-promises.production.js:12:43378) at h (https://myapp.com/steal-with-promises.production.js:12:43378) at h (https://myapp.com/steal-with-promises.production.js:12:43378) at h (https://myapp.com/steal-with-promises.production.js:12:43378) at h (https://myapp.com/steal-with-promises.production.js:12:43378) at h (https://myapp.com/steal-with-promises.production.js:12:43378)
该错误未提供明确的问题定位信息,求问可能的原因是什么?
其他相关信息:
- 还使用以下依赖(已知需升级,正在处理中):
jquery: "3.5.1",
react: "17.0.1",
steal: "^2.2.4",
- app-loader.js代码如下:
import $ from 'jquery'; import {init} from 'myReactApp/appManager'; //!steal-remove-start // import debug from "can-debug"; // debug(); //!steal-remove-end const AppLoader = { applicationRenderer: stache(`<my-app />`), loadApp(param1= false, param2, param3) { init("#app"); $('#app').html(AppLoader.applicationRenderer({param1, param2, param3})); } }; export default AppLoader;
请问有关于该问题的原因或解决方案吗?
再次说明:升级前应用运行正常,且jquery-ui与gridstack关联紧密,无法单独升级其中一个。
内容的提问来源于stack exchange,提问作者Ninita
相关产品推荐
相关产品推荐

