4

I'm completely asea here.

We had a working app build with an old Electron Forge (^5.2.4; 5.2.6) created using the old React template (1.0.2-1.0.4) with the usual suspects of React tech (react-redux, react-router, etc.)

Up until about 1-2 weeks ago everything has been fine. Now, after running its startup code, showing some components, doing some things, then we get a Variant 119 error (ref issues or multiple versions of React).

Since the code used to work the ref thing seems spurious, but I checked all our refs (there are a total of two). I did the usual npm ls and yarn list, even checked a lot of modules for additional Reacts, but found nada.

Our yarn.lock file has not changed other than some internal dependencies that aren't Electron or React related. No external components (BlueprintJS, Semantic UI React, ...) have changed over the course of working-to-non-working.

Here's the kicker: reverting to previously-working versions (including deleting node_modules etc.) doesn't help. The build machine is running the same version of NodeJS as it has been (10.15.mumble). I've tried to track down caches (including Yarn) and deleted them, deleted the out directory, done full rebuilds, etc.

What could be impacting an Electron Forge build like this? What other code, directories, caches, configurations, etc. should I be looking for?

That it impacts previously-working versions points me towards build/environment problems, although this happens across machines, which points back at the project. After multiple days bisecting and rebuilding and having the same thing happen I've paid a visit to Witt's End. And I don't like it there.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302

1 Answers1

0

Looking at the error message, it lists two different reasons for the error. It seems you have ruled out multiple react instances in your code, but be wary if you use npm link as that can do weird things with dependencies.

So have you check to see if someone on your project team checked in something that is trying to use a ref where they shouldn’t as that will also cause this error

David Bradshaw
  • 11,859
  • 3
  • 41
  • 70
  • No npm/yarn links (one one machine there never was one, on the other it was both unlunk and `node_modules` replaced anyway). But yep, definitely something that could cause an error--but was checked :) – Dave Newton Oct 03 '19 at 21:53
  • 1
    If you roll the code back, to the day before the problem started. Does that fix it? Would be good to work out if it a code or infrastructure isssue – David Bradshaw Oct 05 '19 at 08:46
  • "...reverting to previously-working versions (including deleting node_modules etc.) doesn't help" – Dave Newton Oct 05 '19 at 11:57
  • @DaveNewton check if your app is running in dev environment? (electron /path/to/your/app/dir) – Sudhakar Ramasamy Oct 08 '19 at 00:54
  • @SudhakarRV This is the built app; dev mode works fine. Dev console in built app shows nothing unusual until the error, and reverting to previously-good build does not fix the error even with complete node_modules rebuild. That's why I statted I believe it's explicitly a build issue. – Dave Newton Oct 08 '19 at 02:39
  • @DaveNewton I advise you to upgrade the build system to latest instead of trying to fix the older one – Sudhakar Ramasamy Oct 08 '19 at 05:37
  • @DaveNewton Have you checked if you have multiple instances of react with `npm ls react` ? – Vicente Oct 08 '19 at 08:55
  • @Vicente Please see original post. – Dave Newton Oct 08 '19 at 10:37
  • @SudhakarRS Which is what I did--I switched to electron-react-boilerplate. But since that uses much of the same underlying technology it's important to understand what went wrong and how to fix it. – Dave Newton Oct 08 '19 at 17:18