TurboActivate + Electron app issues with spawn('systa')Solved

Hello-- we are using Electron + rollup (like webpack) + Svelte (like React) + LimeLM.  When running dev versions of the app, licensing works well.  But when packaging the app into a distributable using electron-forge, the program throws a “ENOENT” error on the ‘spawn’ line of turboactivate.  It seems it can't find “native/Mac/systa”:

Uncaught Exception:
Error: spawn native/Mac/systa ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)

Where would the turboactivate script expect the files to be?  I've tried copying the “native” folder into the app's “Resources” folder, but the same error occurs.  Is there a PATH issue that prevents TA from locating the systa scripts?

thank you for any help

Whatever you're using to package your app make sure it includes all of the native files, and that the systa file has the appropriate executable permissions. Covered in the article: https://wyday.com/limelm/help/using-turboactivate-with-electron-nodejs/#native-lib-systa

We're using electron-forge.  The app is able to run `systa` in dev mode, and straight from the command line, per the docs.  The `native` folder is alongside the `turboactivate.js` which we are requiring at `app/index.js` (the entry point for the Electron main process).  I've also tried copying the `native` folder at the root where `package.json` and `node_modules/` live.

Attach a debugger and go from there. The packager is messing something up, but it’s beyond the scope of our products.

The issue was not permissions or location of the native directory in fact.  The packaged Electron application has different values for path and process.cwd().  

My solution was to change the ta_files locations to include __dirname at the start of each.  This works cross-platform, and in dev and production.

How are other Electron apps using TurboActivate without changing paths like this?  I see someone else solved it the same exact way here https://wyday.com/forum/t/4774/turboactivate-nodejs-electron-example-help/#post-22152

Thanks, Ethan! We'll fix this in the upcoming release.

Answer

We've pushed the latest fix for the TurboActivate and TurboFloat npm packages. We'll also include the fixed integration files as part of the new release on our API page (no hard date, ASAP).

Thanks for reporting this.

, edited