You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-10-21] Fix the web production build locally not working #69854
Using the npm run web:prod seems to not work reliably and the app runs into the 404 issues. Let's make sure this flow works and developers can run and test the production web build
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
n/A
What alternative solutions did you explore? (Optional)
n/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Currently, the README instructions for production build is:
#### Local production build of the web app
In order to generate a production web build, run `npm run build`, this will generate a production javascript build in the `dist/` folder.
Standard development builds are run with npm run web. For production builds, there is an additional script: npm run web:prod. We can assume that this is proper way to build and run locally production web:
npm run build
npm run web:prod
This successfully starts the local production website, but API requests return a CORS errors or 404 errors (depends on USE_WEB_PROXY env flag). There are likely additional steps required to make it work, possibly including changes to environment files that should be documented in the README or additional proxy commend.
@PiyushChandra17 I tried your solution but it didn’t work. Could you check if there are any additional settings in the environment files? Is there any command that should be run besides these two?
@PiyushChandra17 I did try with that proposition "web:prod": "http-server ./dist --cors -P http://localhost:8080?" and USE_WEB_PROXY set to true in env.production, but got loop with wrong requests in terminal and still offline indicator in web (there is no 404 requests, but it seems not right in terminal for sure).
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
[2025-09-04T12:49:49.048Z] "POST ?/(..)/?/?/?/?/?/?/?/?/?/?/?/?/?/api/SendPerformanceTiming?"
On your side, are you able to interact or log in normally after running that command? I wonder if there’s something else that needs to be configured to make this work.
changed the title [-]Fix the web production build locally not working[/-][+][Due for payment 2025-10-21] Fix the web production build locally not working[/+]on Oct 14, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.30-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Pujan92@abekkala The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Sep 4, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)melvin-bot commentedon Sep 4, 2025
Triggered auto assignment to @abekkala (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.PiyushChandra17 commentedon Sep 4, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Fix the web production build locally not working
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
We need replace http-server with
servehere in order to avoid 404 issuesApp/package.json
Line 79 in 25a9740
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
n/A
What alternative solutions did you explore? (Optional)
n/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
LukasMod commentedon Sep 4, 2025
Currently, the README instructions for production build is:
Standard development builds are run with
npm run web. For production builds, there is an additional script:npm run web:prod. We can assume that this is proper way to build and run locally production web:This successfully starts the local production website, but API requests return a CORS errors or 404 errors (depends on USE_WEB_PROXY env flag). There are likely additional steps required to make it work, possibly including changes to environment files that should be documented in the README or additional proxy commend.
@PiyushChandra17 I tried your solution but it didn’t work. Could you check if there are any additional settings in the environment files? Is there any command that should be run besides these two?
with USE_WEB_PROXY true:
PiyushChandra17 commentedon Sep 4, 2025
@LukasMod In the env prod, we can set
USE_WEB_PROXYENV flag totruehereApp/.env.production
Line 7 in ba30be5
And
-P additional proxy flag"web:prod": "http-server ./dist --cors -P http://localhost:8080?"LukasMod commentedon Sep 4, 2025
@PiyushChandra17 I did try with that proposition
"web:prod": "http-server ./dist --cors -P http://localhost:8080?"and USE_WEB_PROXY set to true in env.production, but got loop with wrong requests in terminal and still offline indicator in web (there is no 404 requests, but it seems not right in terminal for sure).On your side, are you able to interact or log in normally after running that command? I wonder if there’s something else that needs to be configured to make this work.
PiyushChandra17 commentedon Sep 4, 2025
@LukasMod This is exactly what's happening
USE_WEB_PROXY=true - > the app expects the local dev proxy to forward API calls, this kinda works with
npm run webbut not withnpm run web:prodUSE_WEB_PROXY=false - > the app calls the prod API directly - > which leads to CORS/404 restrictions
So just running
this isn't enough
We need:
We need to start the proxy server too along with those two commands
App/package.json
Line 30 in ba30be5
PiyushChandra17 commentedon Sep 4, 2025
USE_WEB_PROXY=truein .env prod56 remaining items
[-]Fix the web production build locally not working[/-][+][Due for payment 2025-10-21] Fix the web production build locally not working[/+]melvin-bot commentedon Oct 14, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 14, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.30-6 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 2025-10-21. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 14, 2025
@Pujan92 @abekkala The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
abekkala commentedon Oct 16, 2025
PAYMENT SUMMARY FOR OCT 21
please complete checklist above - thanks!
Pujan92 commentedon Oct 16, 2025
@abekkala no need for the checklist here.
abekkala commentedon Oct 17, 2025
Thank you @Pujan92
abekkala commentedon Oct 21, 2025
Fix: @TaduJR payment sent via Upwork and contract ended!
PR Review: @Pujan92 [$250] payment via NewDot
THANKS! 🎉
JmillsExpensify commentedon Oct 22, 2025
$250 approved for @Pujan92