"Extension server error: Object not found: <top>", source: devtools://devtools/bundled/extensions/extensions.js (1) code example

Example: Extension server error: Object not found: , source: devtools://devtools/bundled/extensions/extensions.js (216) [9900:1226/171021.620

+  // Open dev tools initially when in development mode
+  if (process.env.NODE_ENV === "development") {
+    mainWindow.webContents.on("did-frame-finish-load", () => {
+      mainWindow.webContents.once("devtools-opened", () => {
+        mainWindow.focus();
+      });
+      mainWindow.webContents.openDevTools();
+    });
+  }