<p dir="auto">On at least two electron apps I noticed that tray icons would disappear after gnome has been locked  and unlocked.</p>
<p dir="auto">My system / these apps:</p>
<ul dir="auto">
<li>Kernel: 5.6.4-arch1-1</li>
<li>Desktop: GNOME Shell 3.36.1</li>
<li>mattermost-desktop 4.4.0-4</li>
<li>riot-desktop: 1.5.15-1</li>
<li>electron: v8.2.2</li>
</ul>

<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Tray icons should be visible after locking and unlocking the screen.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Tray icons appear just fine after the app has been started first. Then they disappear after the screen has been locked at least once.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Start one of the apps in question, activate tray icons. See the tray icon is visible. Lock the screen and unlock again. The tray icon is now missing</p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">By random chance, I noticed a <a href="https://github.com/jiahaog/nativefier/issues/945" data-hovercard-type="issue" data-hovercard-url="/nativefier/nativefier/issues/945/hovercard">similar</a> bugreport which mentions a <a href="https://github.com/telegramdesktop/tdesktop/issues/7541" data-hovercard-type="issue" data-hovercard-url="/telegramdesktop/tdesktop/issues/7541/hovercard">fix</a> for the telegram desktop app. There seems to be a problem with the icon counter, but the telegram app does not use electron. However, maybe it helps.</p>
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">13</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Ubuntu</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">Ubuntu 20</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Electron imports package, no error messages</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">There is and error message when I'm trying to import es6 module to electron main process (specifically ib-tws-api), which breaks the app:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="A JavaScript error occurred in the main process
Uncaught Exception:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/index.js
require() of ES modules is not supported.
require() of /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/index.js from /home/amz/projects/test/electron-boilerplate/app/main.js is an ES module file as it is a .js file whose nearest parent package.json contains &quot;type&quot;: &quot;module&quot; which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove &quot;type&quot;: &quot;module&quot; from /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/package.json."><pre class="notranslate"><code class="notranslate">A JavaScript error occurred in the main process
Uncaught Exception:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/index.js
require() of ES modules is not supported.
require() of /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/index.js from /home/amz/projects/test/electron-boilerplate/app/main.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/amz/projects/test/electron-boilerplate/node_modules/ib-tws-api/package.json.
</code></pre></div>
<p dir="auto">I'm using electron-boilerplate here, but I don't whink it matters.<br>
Not sure if it's really a bug, but I couldn't figure it out. There has to be the way to import this package. I searched everywhere and couldn't find any solutions. I'm sure I could just convert the package to use commonjs, but I think there are simpler ways.</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto"><em>No response</em></p>