Tried to run the app on Windows and saw this error:
This seems like a bug in electron-store but this led me to realize that electron-store is creating directories under the hood if the name field passed to an electron store instance contains a / which it does in development since we use the Base URL (e.g. http://locahost:3000, https://staging.replit.com) to seed the name to create different stores for the different modes of development. This was easy to confirm by looking in the Application Support directory on Mac which is where the logs get written to:
Instead, we should be a bit smarter about it and create explicit filenames for each (local, staging, prod, etc) that do not include a /.
What changed
Fix electron-store creating dirs in dev
Test plan
Should not be creating new dirs for the store and instead writing to config-dev-local, config-dev-staging, etc. Prod should remain the same.
Why
Tried to run the app on Windows and saw this error:
This seems like a bug in
electron-store
but this led me to realize that electron-store is creating directories under the hood if thename
field passed to an electron store instance contains a/
which it does in development since we use the Base URL (e.g.http://locahost:3000
,https://staging.replit.com
) to seed the name to create different stores for the different modes of development. This was easy to confirm by looking in theApplication Support
directory on Mac which is where the logs get written to:Instead, we should be a bit smarter about it and create explicit filenames for each (local, staging, prod, etc) that do not include a
/
.What changed
Fix electron-store creating dirs in dev
Test plan
Should not be creating new dirs for the store and instead writing to
config-dev-local
,config-dev-staging
, etc. Prod should remain the same.