碰到一个问题,cocos creator 2.4.14打包的H5项目运行在微信浏览器,部分手机一定概率会报Uncaught TypeError: Cannot read properties of null (reading ‘getParameter’) 这个错误,且不是必然的是偶发的,有时候好的正常的,有时候会报错造成页面就卡死在首页了
定位到引擎的代码是Creator\2.4.14\resources\engine\cocos2d\renderer\gfx文件夹的device.js文件的_initCaps函数中,gl是null造成,也就是webgl初始化失败了
-
Creator 版本: 2.4.14
-
目标平台: 微信浏览器
-
重现方式:一定概率
-
首个报错: Uncaught TypeError: Cannot read properties of null (reading ‘getParameter’) @ (/cocos2d-js-min.f9151.js:1:953552) Error.message: Cannot read properties of null (reading ‘getParameter’) \n Error.stack: TypeError: Cannot read properties of null (reading ‘getParameter’)\n at t._initCaps