Electron App: Production version work differently compared to the development one

I am working with an Electron App. It required an authentication mechanism working as below:

  • There is a main window which displays almost info including the data and login status.
  • When the user is not authorized, a Login button will show up instead.
  • The login function will load the user to a proxy server url in which the users can input their username and password.
  • If the user input is correct, an successfull message may have returned and then the user will be authorized.

The issue was that I clicked the Login button on the development env, the proxy server window had been poped up so I could input my username and password, however, it seemed to work differently after I had built the application to the exe file as the Login mechanism automatically had invoked and it showed the success message although I had not input my username and password again.

This is the deps I am using

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>"dependencies": {
"@electron/remote": "2.1.2",
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@mui/icons-material": "6.1.1",
"@mui/lab": "6.0.0-beta.10",
"@mui/material": "6.1.1",
"@mui/x-tree-view": "^7.18.0",
"@reduxjs/toolkit": "^2.2.7",
"clsx": "2.1.1",
"cors": "2.8.5",
"cross-env": "7.0.3",
"date-fns": "4.1.0",
"dotenv-cli": "^7.4.2",
"electron-log": "5.2.0",
"electron-store": "8.2.0",
"express": "4.21.0",
"js-yaml": "4.1.0",
"node-disk-info": "1.3.0",
"node-stream-zip": "^1.15.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-redux": "9.1.2",
"redux": "5.0.1",
"redux-devtools-extension": "2.13.9",
"redux-thunk": "3.1.0",
"semver": "7.6.3",
"unzipper": "^0.12.3",
"xml2js": "0.6.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"build-electron": "tsc -p tsconfig.electron.json",
"watch-electron": "tsc -p tsconfig.electron.json -w",
"start-electron": "electron dist/index.js",
"dev-electron": "cross-env NODE_ENV=development electron dist/index.js",
"postinstall": "electron-builder install-app-deps",
"release": "dotenv -- electron-builder --win -c.extraMetadata.main=dist/index.js",
"licenses": "license-checker-rseidelsohn --csv --production --direct --out licenses.csv",
"testBuild": "npm run build && npm run start-electron"
},
"devDependencies": {
"@testing-library/jest-dom": "6.5.0",
"@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/express": "4.17.21",
"@types/jest": "29.5.13",
"@types/js-yaml": "^4.0.9",
"@types/node": "22.5.5",
"@types/react": "18.3.8",
"@types/react-dom": "18.3.0",
"@types/react-redux": "7.1.33",
"@types/semver": "7.5.8",
"@types/unzipper": "^0.10.10",
"@types/xml2js": "0.4.14",
"ajv": "^8.17.1",
"devtron": "1.4.0",
"electron": "32.1.2",
"electron-builder": "25.0.5",
"license-checker-rseidelsohn": "4.4.2",
"npm-check-updates": "^17.1.2",
"postcss-normalize": "^13.0.0",
"prettier": "3.3.3",
"react-scripts": "5.0.1",
"typescript": "5.6.2"
},
</code>
<code>"dependencies": { "@electron/remote": "2.1.2", "@emotion/react": "11.13.3", "@emotion/styled": "11.13.0", "@mui/icons-material": "6.1.1", "@mui/lab": "6.0.0-beta.10", "@mui/material": "6.1.1", "@mui/x-tree-view": "^7.18.0", "@reduxjs/toolkit": "^2.2.7", "clsx": "2.1.1", "cors": "2.8.5", "cross-env": "7.0.3", "date-fns": "4.1.0", "dotenv-cli": "^7.4.2", "electron-log": "5.2.0", "electron-store": "8.2.0", "express": "4.21.0", "js-yaml": "4.1.0", "node-disk-info": "1.3.0", "node-stream-zip": "^1.15.0", "react": "18.3.1", "react-dom": "18.3.1", "react-redux": "9.1.2", "redux": "5.0.1", "redux-devtools-extension": "2.13.9", "redux-thunk": "3.1.0", "semver": "7.6.3", "unzipper": "^0.12.3", "xml2js": "0.6.2" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "build-electron": "tsc -p tsconfig.electron.json", "watch-electron": "tsc -p tsconfig.electron.json -w", "start-electron": "electron dist/index.js", "dev-electron": "cross-env NODE_ENV=development electron dist/index.js", "postinstall": "electron-builder install-app-deps", "release": "dotenv -- electron-builder --win -c.extraMetadata.main=dist/index.js", "licenses": "license-checker-rseidelsohn --csv --production --direct --out licenses.csv", "testBuild": "npm run build && npm run start-electron" }, "devDependencies": { "@testing-library/jest-dom": "6.5.0", "@testing-library/react": "16.0.1", "@testing-library/user-event": "14.5.2", "@types/express": "4.17.21", "@types/jest": "29.5.13", "@types/js-yaml": "^4.0.9", "@types/node": "22.5.5", "@types/react": "18.3.8", "@types/react-dom": "18.3.0", "@types/react-redux": "7.1.33", "@types/semver": "7.5.8", "@types/unzipper": "^0.10.10", "@types/xml2js": "0.4.14", "ajv": "^8.17.1", "devtron": "1.4.0", "electron": "32.1.2", "electron-builder": "25.0.5", "license-checker-rseidelsohn": "4.4.2", "npm-check-updates": "^17.1.2", "postcss-normalize": "^13.0.0", "prettier": "3.3.3", "react-scripts": "5.0.1", "typescript": "5.6.2" }, </code>
"dependencies": {
        "@electron/remote": "2.1.2",
        "@emotion/react": "11.13.3",
        "@emotion/styled": "11.13.0",
        "@mui/icons-material": "6.1.1",
        "@mui/lab": "6.0.0-beta.10",
        "@mui/material": "6.1.1",
        "@mui/x-tree-view": "^7.18.0",
        "@reduxjs/toolkit": "^2.2.7",
        "clsx": "2.1.1",
        "cors": "2.8.5",
        "cross-env": "7.0.3",
        "date-fns": "4.1.0",
        "dotenv-cli": "^7.4.2",
        "electron-log": "5.2.0",
        "electron-store": "8.2.0",
        "express": "4.21.0",
        "js-yaml": "4.1.0",
        "node-disk-info": "1.3.0",
        "node-stream-zip": "^1.15.0",
        "react": "18.3.1",
        "react-dom": "18.3.1",
        "react-redux": "9.1.2",
        "redux": "5.0.1",
        "redux-devtools-extension": "2.13.9",
        "redux-thunk": "3.1.0",
        "semver": "7.6.3",
        "unzipper": "^0.12.3",
        "xml2js": "0.6.2"
    },
"scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "build-electron": "tsc -p tsconfig.electron.json",
        "watch-electron": "tsc -p tsconfig.electron.json -w",
        "start-electron": "electron dist/index.js",
        "dev-electron": "cross-env NODE_ENV=development electron dist/index.js",
        "postinstall": "electron-builder install-app-deps",
        "release": "dotenv -- electron-builder --win -c.extraMetadata.main=dist/index.js",
        "licenses": "license-checker-rseidelsohn --csv --production --direct --out licenses.csv",
        "testBuild": "npm run build && npm run start-electron"
    },
"devDependencies": {
        "@testing-library/jest-dom": "6.5.0",
        "@testing-library/react": "16.0.1",
        "@testing-library/user-event": "14.5.2",
        "@types/express": "4.17.21",
        "@types/jest": "29.5.13",
        "@types/js-yaml": "^4.0.9",
        "@types/node": "22.5.5",
        "@types/react": "18.3.8",
        "@types/react-dom": "18.3.0",
        "@types/react-redux": "7.1.33",
        "@types/semver": "7.5.8",
        "@types/unzipper": "^0.10.10",
        "@types/xml2js": "0.4.14",
        "ajv": "^8.17.1",
        "devtron": "1.4.0",
        "electron": "32.1.2",
        "electron-builder": "25.0.5",
        "license-checker-rseidelsohn": "4.4.2",
        "npm-check-updates": "^17.1.2",
        "postcss-normalize": "^13.0.0",
        "prettier": "3.3.3",
        "react-scripts": "5.0.1",
        "typescript": "5.6.2"
    },

Please give me some advices if anyone faced this previously.
I want the built exe version works exactly like the one on my development environment.

New contributor

Eric Trinh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật