Javascript Firebase和VueJS:Uncaught(在promise中)DomeException:用origin“阻塞了一个框架”;http://localhost:3000"

Javascript Firebase和VueJS:Uncaught(在promise中)DomeException:用origin“阻塞了一个框架”;http://localhost:3000",javascript,vuejs2,firebase-authentication,nuxt.js,Javascript,Vuejs2,Firebase Authentication,Nuxt.js,我正在遵循firebase auth官方教程,我不断收到以下代码的错误: const provider = new firebase.auth.GoogleAuthProvider() firebase.auth() .signInWithPopup(provider) .catch((error) => alert(error.message)) .then((data) => console.log(data.user,

我正在遵循firebase auth官方教程,我不断收到以下代码的错误:

const provider = new firebase.auth.GoogleAuthProvider()
      firebase.auth()
        .signInWithPopup(provider)
        .catch((error) => alert(error.message))
        .then((data) => console.log(data.user, data.credential.accessToken))
以下是我的控制台错误:

backend.js:12632 Uncaught (in promise) DOMException: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
我在身份验证控制台中将localhost作为白名单域

我也需要添加端口吗?假设这会有帮助……但任何建议都将不胜感激。多谢各位


仅供参考,我使用的是Nuxt(Vue)

我想这可能是因为
signInWithPopup
为身份验证提供程序加载了

我无法从单独发布的代码中判断,但我猜您可能正在使用google或facebook auth provider,并且您需要使用auth provider将localhost列入白名单,这是您无法做到的


如果是这样的话,最简单的方法可能是使用像ngrok这样的代理来获得一个可通过web访问的临时服务器(使用https也可能有帮助)

忘了提到,在使用FirebaseUI库时,我没有遇到任何问题,一切正常。如果我不能解决上面的问题,我将使用它。当我为生产构建并部署到远程服务器时,它可以正常工作。谢谢你的评论。