question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error attempting to call function in renderer window that has been closed

See original GitHub issue

I have a head.html file which is imported into all my other html files, inside the head.html file is a script with the following code

const customTitlebar = require('custom-electron-titlebar');

new customTitlebar.Titlebar({
    backgroundColor: customTitlebar.Color.fromHex('#262626')
});

Although whenever I interact with my application I get this error

Attempting to call a function in a renderer window that has been closed or released. Function provided here: Titlebar.registerListeners (D:\Projects\electron-app\node_modules\custom-electron-titlebar\lib\titlebar.js:50:28

It only appears in the console however so does not actually affect my app but I want to know why it is erroring.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
RHulshizercommented, Jul 10, 2019

Hi. I get this same error, but I can assure you that my code only executes once, as it is in Index.html:

const customTitlebar = require(‘custom-electron-titlebar’); new customTitlebar.Titlebar({ backgroundColor: customTitlebar.Color.fromHex(‘#444’), icon: ‘./assets/icon.png’ });

See screenshot error

1reaction
yafpcommented, Oct 7, 2019

Got the same issue, using version 3.1.0.

It happens i.e. when my app lost focus and then gets focus again. Resulting output:

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: titlebar.js:56:28
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: titlebar.js:56:28
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: titlebar.js:69:28
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: titlebar.js:69:28

so from registerListeners.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Attempting to call a function in a renderer window that ...
Electron version:v1.2.3 Operating system:Mac OS X 10.11.5 page A code: const electron = nodeRequire('electron'); const remote ...
Read more >
Uncaught exception: Attempting to call a function in a renderer ...
... app I get the following error: Uncaught Exception: Attempting to call a function in a renderer window that has been closed or...
Read more >
Attempting to call a function in a renderer window that has ...
Attempting to call a function in a renderer window that has been closed or released. Function provided here: undefined.
Read more >
BrowserWindow | Electron
If a BrowserWindow is created with show: false , the initial visibility state will be visible despite the window actually being hidden.
Read more >
Call JavaScript functions from .NET methods in ASP.NET Core ...
Learn how to invoke JavaScript functions from . ... To call window. ... If you were rendering a list of map elements from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found