[No QA] Fix desktop for developers without .env file#7719
Merged
Conversation
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
kidroca
reviewed
Feb 14, 2022
Comment on lines
184
to
+186
| const devEnvConfig = dotenv.config({path: path.resolve(__dirname, '../.env')}).parsed; | ||
|
|
||
| if (devEnvConfig.USE_WEB_PROXY === 'true') { | ||
| if (devEnvConfig.USE_WEB_PROXY !== 'false') { |
Contributor
There was a problem hiding this comment.
Hey, sorry you still have to have an .env file to make this work
When you don't have an .env file parsed - devEnvConfig is undefined and you get this error:
[Main] 14:10:46.010 › (node:8157) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'USE_WEB_PROXY')
[Main] at /Users/kidroca/Desktop/Freelance/Expensify.cash/desktop/main.js:186:34
What the proxy script does is a bit more flexible and you don't need to import path
dotenv.config();
if (process.env.USE_WEB_PROXY !== 'false') ...When you don't pass a path to dotenv it will use .env by default
If there is such a file the variables defined would be assigned to process.env
Contributor
Author
There was a problem hiding this comment.
Whoops ... I encountered this locally and had committed but not pushed the fix 😞
1 task
85 tasks
Contributor
Contributor
69 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cc @kidroca
Details
Following-up on #7693 (comment) – the Electron app is currently broken for developers not having a
.envfile.Fixed Issues
$ n/a
Tests
.envor temporarily move it somewhere else.npm run desktopQA Steps
None (dev only)
Tested On
Screenshots
Desktop