所以,我有一个ReactApp,它使用firebase登录,登录后就可以使用该应用程序。但是,当尝试登录时,弹出窗口打开,几秒钟后,它关闭,不允许我登录。我认为问题出在电子的某个地方,只是看不到哪里,这是尝试打开弹出窗口时它给我的错误消息:
“ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD”的处理程序中发生错误:错误 guestId 无效:2
我将在这里留下部分代码,以便您可以看到它是如何编写的。这是电子代码:
const { app, BrowserWindow } = require('electron')
const path = require('path')
const isDev = require('electron-is-dev')
function createWindow () {
const win = new BrowserWindow({
width: 1280,
height: 720,
webPreferences: {
nodeIntegration: true
}
})
win.loadURL(
isDev ? "http://localhost:3000"
:
`file://${path.join(__dirname, "../build/index.html")}`
)
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
Run Code Online (Sandbox Code Playgroud)
这是 firebase 代码:
const firebaseConfig = { …
Run Code Online (Sandbox Code Playgroud)