osa2 icon indicating copy to clipboard operation
osa2 copied to clipboard

bug with babel-preset-env only in a production built electron app

Open michaeljelly opened this issue 3 years ago • 0 comments

I found this PR https://github.com/wtfaremyinitials/osa2/pull/1 caused serious issues in running osa2 in a built electron app using hardened runtime. When running in dev-mode no issues caused, so a gnarly bug to find.

Specifically, it caused the bug: Error: Couldn't find preset "env" relative to directory "/"

And this happened every time I called osa2. To fix it, I reverted back to 0.2.2 and did a clean reinstall. I suspect this is a problem with the interaction with the old babel-core and babel-preset env. The newest versions are @babel/core and @babel/preset-env if anyone wants this functionality - I personally don't need it or the overhead!

Given how straightforward the use-case is for this library, it might be a very simple clean upgrade to the new babel and someone could find it worthwhile to drop it in.

But I know nothing about babel and am deep in a pre-launch marathon so won't be doing this until/unless I ever need it later!

To replicate: execute osa2 in an Electron app built with electron-builder and notarised with electron-builder-notarize, using hardened-runtime. (don't know if all these steps are needed, but that was my situation)

michaeljelly avatar Feb 15 '22 23:02 michaeljelly