在mpvue项目中按照环境动态引入阿拉丁统计sdk
出现错误:
thirdScriptError
sdk uncaught third Error
Cannot read property 'getElementsByTagName' of undefined
TypeError: Cannot read property 'getElementsByTagName' of undefined
at Function.o.e (http://127.0.0.1:60977/appservice/common/manifest.js:21:36)
at Object.dcK (http://127.0.0.1:60977/appservice/app.js:6:7)
at o (http://127.0.0.1:60977/appservice/common/manifest.js:39:91)
at Object.NHnr (http://127.0.0.1:60977/appservice/app.js:29:13)
at o (http://127.0.0.1:60977/appservice/common/manifest.js:39:91)
at Object.global.webpackJsonpMpvue (http://127.0.0.1:60977/appservice/common/manifest.js:13:13)
at http://127.0.0.1:60977/appservice/app.js:5:8
at require (http://127.0.0.1:60977/appservice/__dev__/WAService.js:1:1016120)
at <anonymous>:1:1
at HTMLScriptElement.scriptLoaded (http://127.0.0.1:60977/appservice/appservice?t=1564644391858:21225:21)
解决办法:把import变为require.
网友评论