The error I got after deployment(部署后得到的错误) "TypeError: i.then is not a function"
Version
3.2.8
Reproduction link
Steps to reproduce
- Go to https://imooc-admin.lgdsunday.club/ link
- Log in
- Then the console will throw "TypeError: i.then is not a function"
- 进入 https://imooc-admin.lgdsunday.club/ 链接
- 进行登录
- 之后控制台会抛出 《TypeError: i.then is not a function》
What is expected?
Can enter normally
可以正常进入
What is actually happening?
TypeError: i.then is not a function
This is an unexpected error. I can perform login follow-up operations normally during development, but once deployed, I will get a "TypeError: i.then is not a function" error. I intercepted the corresponding part of the code, only knowing that the exception was thrown in the following code, but I don't know the reason?
这是一个意料之外的错误。 我在开发时可以正常进行登录后续操作,但是一旦部署将会得到一个《TypeError: i.then is not a function》的错误。 我截取对应的代码部分,只能知道是在下列代码中抛出了异常,但是却不知道原因是什么?
function Re(e, t, n, o) {
const r = []
for (const a of e)
for (const e in a.components) {
let l = a.components[e]
if ('beforeRouteEnter' === t || a.instances[e])
if ($e(l)) {
const i = l.__vccOpts || l,
c = i[t]
c && r.push(ze(c, n, o, a, e))
} else {
let i = l()
0,
r.push(() =>
i.then((r) => {
if (!r)
return Promise.reject(
new Error(`Couldn't resolve component "${e}" at "${a.path}"`)
)
const l = p(r) ? r.default : r
a.components[e] = l
const i = l.__vccOpts || l,
c = i[t]
return c && ze(c, n, o, a, e)()
})
)
}
}
return r
}