0

I've got an electron app with vite/xstate/react. In development I'm seeing just a single xstate.init event emitted when starting up the app. But in production builds, I see two xstate.init events (there should only be one, triggered by xstate itself upon initialising):

enter image description here

enter image description here

I'm logging the event out (renderer process, so it shows up in dev tools). It comes from the same file/chunk, but for some reason, dev tools show two different paths to the same file (file:///Users/... vs /Users/...). This is causing some bad bugs where things get ran twice in some cases. I'm trying to narrow down the issue here. Is this some sort of issue with electron and the build files?

timothym
  • 2,853
  • 5
  • 19
  • 26
  • I don't see similar log messages between environments in Electron apps I've built, could there possibly be something in your code that is executing twice? – reZach Jul 28 '22 at 05:18
  • @reZach this is what I initially thought, but I haven't been able to figure out why this would only happen in production builds of my electron app, and not locally in development. – timothym Jul 28 '22 at 08:48
  • are you able to post any code you _feel_ is causing this. I'm not yet swayed it's the build process. – reZach Jul 28 '22 at 16:46

0 Answers0