App: [HOLD for payment 2022-02-01] Running node run web after initial repo setup errors out if you haven't had the ./dist folder - Reported by @CSFlorin
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Run
node run webafter initial repo setup
Expected Result:
No error should display after user runs node run web after initial repo setup
Actual Result:
Running node run web after initial repo setup errors out if you haven’t had the ./dist folder
Full error:
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, open '/Users/g/App/dist/version.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/g/App/dist/version.json'
}
Context The issue is in config/webpack/CustomVersionFilePlugin.js where fs.writeFile fails if any of the file’s parent directories don’t exist. A solution is wrapping that call in a call to fs.mkdir with the recursive strategy to first create any of the file’s parent directories if they don’t yet exist (example here). Note: I’m on Mac but from the history here, it seems this affects Windows and Linux too (I’d assume fs 's methods interact consistently with different OSes)
Workaround:
unknown
Platform:
Where is this issue occurring?
- Web
Version Number: 1.1.24-0 Reproducible in staging?: Y Reproducible in production?: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL: Issue reported by: @CSFlorin Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1640764185210000
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (19 by maintainers)
@CSFlorin Contributors don’t get access to push directly to this repository. Steps you should follow -
Let me know if you have any questions, and please make sure to read CONTRIBUTING.md Thanks so much!
@stephanieelliott on second thought this should be good for an external contributor to tackle since @CSFlorin was able to confirm!
All paid up, thanks @rushatgabhane!
Haha, thanks so much! @stephanieelliott
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.32-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2022-02-01. 🎊
Thanks @rushatgabhane Here is the PR 😃 https://github.com/Expensify/App/pull/7300
Ah thanks, I forgot I made it private - invited you to the job in Upwork!
@CSFlorin your proposal looks good, @stephanieelliott let’s hire @CSFlorin for this one! @CSFlorin once you are hired feel free to start on a PR.
🎀👀🎀 C+ reviewed
I like @CSFlorin’s proposal. It fixes the issue, recursive strategy is needed, and yeah all the errors are handled properly.
cc: @Jag96
Job is on Upwork here: https://www.upwork.com/jobs/~01bd37d23f5bb554fd
@CSFlorin, as the reporter of this issue, you have first dibs on fixing it! Please post your proposal here if you have one.
@jasperhuangg I confirmed the same thing happens with
npm run web. To reproduce for yourself, you may clone the repo, follow steps to set up in README.md, and run that command. I expect the same across systems.@mvtglobally Can you check with @CSFlorin if it works if they use
npm run webinstead ofnode run web? I’m not very familiar with this but that’s the one thing that stands out to me.@stephanieelliott This may not need to be exported if @CSFlorin was using the wrong command.