Skip to content

[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 #7011

Description

@mvtglobally

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:

  1. Run node run web after 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

View all open jobs on GitHub

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionEngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions