Skip to content

V1.0.5 - Add Electron Support

Latest

Choose a tag to compare

@bilooDev bilooDev released this 25 Feb 07:28

Root causes found:

  1. Singleton bridge ignored custom options — index.ts creates a default Toast() at import time via getBridge(), creating a singleton Bridge. When your code later called new Toast({ executablePath: ... }), getBridge() returned the same Bridge instance — your executablePath was never applied.
  2. Asar path resolution — findExecutable() used __dirname which resolves inside app.asar. Electron's patched fs.existsSync() returned true for paths inside asar, but child_process.spawn() can't execute from asar archives → ENOENT.

Fixes applied to win-native-toast package (bridge.ts):
• Added resolveAsarPath() — translates app.asar paths to app.asar.unpacked
• findExecutable() now resolves asar paths before checking existence
• start() resolves asar paths before spawning, with a helpful error message if asarUnpack is missing
• Added updateOptions() method + fixed getBridge() to apply new options to an unstarted singleton bridge

Fixes applied to gpro-delevery-server:
• package.json now points to local package (file:D:\Packages...)
• winNativeToast.mjs simplified — no more manual path resolution needed